rsauex / cl-yatlp

Yet another tool for language processing
MIT License
1 stars 0 forks source link

New grammar format #8

Open rsauex opened 7 years ago

rsauex commented 7 years ago

Current grammar representation is not highly readable.

  1. :or rule is redundant. We can recognize that the rule is of 'or' type by the number of alternatives.
  2. Maybe, use something like -> (or even ) at the beginning of each alternative, it can help with getting rid of redundant parentheses.
  3. Maybe, use unicode ε instead of :eps.
  4. Maybe, use symbols instead keywords for all control keyword (:^, :+, :*) 4.1 Possibly use special symbols at the start of an alternative (instead of ->) to designate the type of rule. (e.g. *->)

Example:

(expr -> expr1 "+" expr
      -> expr1 "-" expr
      -> ^ expr1
      -> ε)
rsauex commented 7 years ago

Partly done. Need to rewrite readme.

rsauex commented 7 years ago

Readme updated. Consider something about * and +, maybe ^.

rsauex commented 7 years ago

Unite lexer and parser grammars.