Jack Grammar

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Jack Grammar

cadet1620
Administrator
This post was updated on .
HTML for printing
  JackSyntax-1.html
Text you can paste into program comments
  JackSyntax.txt
Reply | Threaded
Open this post in threaded view
|

Re: Jack Grammar

ouverson
This post was updated on .
Could some please help confirm terminals. I changed the color and font size to make terminals stand out.

jack_grammar.html
Reply | Threaded
Open this post in threaded view
|

Re: Jack Grammar

WBahn
Administrator
For the most part it looks good, but there are terminals that aren't indicated because they aren't expressed as literals in the grammar. For instance, an identifier is a terminal. In fact, the first category, "Lexical Elements", are ALL terminals. Any stringConstant is a terminal (the entire string, not just the quotes that delimit it) and any integerConstant is a terminal.

In a truly properly expressed grammar the terminals would be nothing more than the set of characters that can appear in the source code. But that is carrying things a bit to far if the objective is to make things better match the level at which humans think. So we strike a balance and call certain collections of characters, such as identifiers, a terminal. The point being, that there is wiggle room on what gets called a terminal and what doesn't.
Reply | Threaded
Open this post in threaded view
|

Re: Jack Grammar

ouverson
Thank you for your clarification; I made edits to HTML to reflect your input.