|
<< Click to Display Table of Contents >> A quick primer on parsing |
![]() ![]()
|
Before we proceed with the following more detailed section on parser and object structures, a more introductory primer on parsing is presented in this section.
Parsers deal with syntax, and the question is how to fit a given Gekko command file (statements) to a given syntax (grammar). So a parser tries to follow language rules (stated in a grammar), in order to 'produce' corresponding C# statements that can be executed by Gekko. When the parser succeeds, we can say that the command (file) is 'understood', or at least there are no syntactical errors or ambiguities present.
In this section, we will try to parse the expression a + b + c using a recursive grammar, and later on a simple series statement is parsed, too.