I am writing regular expressions with PLY but it seems it doesn't behave like yacc.
I've written this:
def p_expression_TYPE (p):
'''
TYPE : [' Discrete ', ' Continuous ' ]
'''
to express the fact that a TYPE can only take those values: Discrete, or Continuous.
I have the followed errors:
ERROR: la_grammaire_yacc.py:31: Illegal name '['' in rule 'TYPE'
Could somebody tell me what's wrong with my code? Must I definethose king of expressions as tokens?
Thanks to you