GEOS SDK TechDocs
|
|
|
1 Parse Library Behavior
The Parse Library was originally created to provide a parser for a spreadsheet language. However, it will also fit the needs of a programmer who wants to implement a language based on mathematical expressions.
The Parse Library takes an expression as text, converts it to an expression using tokens, and evaluates the expression. When finished, it converts the result back into text and returns it. The Parse Library recognizes a special grammar and set of expressions that include an interface to the Cell Library's data structures. Therefore, you can use the Cell and Parse Libraries together to form the basic underlying engine of a spreadsheet application.
You may want to familiarize yourself with how compilers work before you read this section. In particular, you should understand how scanners use regular expressions to translate raw text into token streams; and you should be familiar with the parsing of context-free grammars. A good book to look at is Compilers: Principles, Techniques, and Tools by Aho, Sethi, and Ullman (a.k.a. "The Red Dragon Book").
1 Parse Library Behavior
1.1 The Scanner
1.2 The Parser
1.3 Evaluator
1.4 Formatter
2 Parser Functions
2.1 Internal Functions
2.2 External Functions
3 Coding with the Parse Library
3.1 Parsing a String
3.2 Evaluating a Token Sequence
3.3 Formatting a Token Sequence
GEOS SDK TechDocs
|
|
|
1 Parse Library Behavior