Definitions

As seen in the syntax: We work with five (or six) different define mechanism. Let us list them

A minimum for creating a parser is a set of productions. If any operator ambiguities are present, precedence and associativity is needed. If a token is not defined, the generator will insert the token name in the regular expression.

The tokens are placed in the regular expression in the order they appear in the source code. This is crucial since a regular expression that is a substring of a later regular expression can cancel out the latter, ex. ab|abcd - in this case the string abcd will be matched by the first choice of the regex, leaving cd not to be matched at all.

If some string is present in the input that is not defined one way or the other as a token, the lexer will terminate with an "garbage in expression" error.

The parser will generate syntax errors when the input string does not conform to the syntax.

Share