ANN: Infix expression parsers included into simple components v1.4

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
26 Feb 2004 01:14:12 -0500

          From comp.compilers

Related articles
ANN: Infix expression parsers included into simple components v1.4 mailbox@dmitry-kazakov.de (Dmitry A. Kazakov) (2004-02-26)
| List of all articles for this month |

From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Newsgroups: comp.compilers
Date: 26 Feb 2004 01:14:12 -0500
Organization: At home
Keywords: parse
Posted-Date: 26 Feb 2004 01:14:12 EST

http://www.dmitry-kazakov.de/ada/components.htm


Parsers can be used for syntax analysis of infix expressions, i.e. ones
containing infix (dyadic), prefix and postfix operators, brackets, function
calls, array indices etc. The approach presented does not require any
grammar put down to generate scanner and analyzer. Nor any code generation
steps are required. An object-oriented approach is used instead. The
lexical procedures are dispatching, so that implementations may be provided
through overriding them. Parsers can be used both for immediate one-pass
code interpretation and for parsing tree building. Parser automatically
detects the expression end allowing its easy integration. Operator
precedence is expressed in a native way by setting priorities controlling
association with the operands. Associations with the left and right side
operands are controlled independently. Commutative operators and their
inverses can be optimized when necessary. Especial attention is paid to
error handling allowing generating very precise error messages and source
code references. Samples from a small console calculator to a complete
parsing tree generator for Ada 95 expressions illustrate examples of use.


--
Regards,
Dmitry A. Kazakov
www.dmitry-kazakov.de


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.