Parsing Complex Text Structures
By Ian E. Gorman, June 01, 2000
A pattern language that includes recursive patterns and conditional pattern matching can handle complex text structures without supplementary programming. Ian uses the OmniMark pattern language from OmniMark Technologies to do a job that might otherwise be done with tools like lex and yacc.
Jun00: Programmer's Toolchest
expression -> term r-expression
r-expression -> epsilon
| "+" term r-expression
| "-" term r-expression
term -> factor r-term
r-term -> epsilon
| "+" factor r_term
| "-" factor r_term
factor -> "(" expression ")"
| integer
Example 6: Grammar with left recursion removed.