[TriPython] A question of recursion and nested parsing
Scott G. Hall
scott at hallcomm-inc.com
Fri Sep 15 17:52:05 EDT 2017
When I learned language parsing (early 1980's) and worked as a research grunt on
the C Standards Committee (for Howard at Computer Innovations and the C86-Plus
compiler...), we used a tree model to represent syntax:
Drawing Tree Diagrams: Problems and Suggestions
<http://www.academypublication.com/issues/past/jltr/vol01/06/29.pdf>
(http://www.academypublication.com/issues/past/jltr/vol01/06/29.pdf)
also used for YACC syntax (Yet Another Compiler Compiler -- a parsing generator)
which is in-turn based on Linguistics parsing trees:
Syntax - Drawing tree diagrams of ambiguous sentences generated by a CFG
<https://linguistics.stackexchange.com/questions/9706/drawing-tree-diagrams-of-ambiguous-sentences-generated-by-a-cfg>
(https://linguistics.stackexchange.com/questions/9706/drawing-tree-diagrams-of-ambiguous-sentences-generated-by-a-cfg)
Then there's always the /Backus-Naur Form/ (Backus Normal Form) that was used in
the late 1980's and early 1990's by /Dr. Dobb's Journal/ and the /C/C++ User's
Journal/:
Notations for context-free grammers: BNF, Syntax Diagrams, EBNF
<http://www.cs.man.ac.uk/%7Epjj/bnf/bnf.html>
(http://www.cs.man.ac.uk/~pjj/bnf/bnf.html
<http://www.cs.man.ac.uk/%7Epjj/bnf/bnf.html>)
The /railroad/ syntax diagrams seem intriguing though.
- sgh
On 09/15/2017 12:00 PM, David Burton wrote:
> Parsing problems are always**best solved by first creating a formal syntax
> specification. There are no non-trivial exceptions to that rule. You
> should not write any code until you have done that.
> If you haven't done a formal syntax spec then you do not yet fully
> understand the problem you're working on, and you should not be writing
> code.
>
> Sometimes it helps to know what you're doing.
> - Quotations from Prof. Kwan(sp?)
>
> My preference is for Pascal-esque syntax diagrams (a/k/a "railroad
> diagrams"), like these:
> [1]http://primepuzzle.com/tp2/syntax-diagrams.html
> [2]https://www.google.com/search?q=%22syntax+diagram%22
--
Scott G. Hall
Raleigh, NC, USA
ph. 919-624-5973
Scott at HallComm-Inc.Com
-------------- next part --------------
When I learned language parsing (early 1980's) and worked as a research
grunt on the C Standards Committee (for Howard at Computer Innovations and
the C86-Plus compiler...), we used a tree model to represent syntax:
[1]Drawing Tree Diagrams: Problems and Suggestions
([2]http://www.academypublication.com/issues/past/jltr/vol01/06/29.pdf)
also used for YACC syntax (Yet Another Compiler Compiler -- a parsing
generator) which is in-turn based on Linguistics parsing trees:
[3]Syntax - Drawing tree diagrams of ambiguous sentences generated by a
CFG
([4]https://linguistics.stackexchange.com/questions/9706/drawing-tree-diagrams-of-ambiguous-sentences-generated-by-a-cfg)
Then there's always the Backus-Naur Form (Backus Normal Form) that was
used in the late 1980's and early 1990's by Dr. Dobb's Journal and the
C/C++ User's Journal:
[5]Notations for context-free grammers: BNF, Syntax Diagrams, EBNF
([6]http://www.cs.man.ac.uk/~pjj/bnf/bnf.html)
The railroad syntax diagrams seem intriguing though.
- sgh
On 09/15/2017 12:00 PM, David Burton wrote:
Parsing problems are always**best solved by first creating a formal syntax
specification. There are no non-trivial exceptions to that rule. You
should not write any code until you have done that.
If you haven't done a formal syntax spec then you do not yet fully
understand the problem you're working on, and you should not be writing
code.
Sometimes it helps to know what you're doing.
- Quotations from Prof. Kwan(sp?)
My preference is for Pascal-esque syntax diagrams (a/k/a "railroad
diagrams"), like these:
[1][7]http://primepuzzle.com/tp2/syntax-diagrams.html
[2][8]https://www.google.com/search?q=%22syntax+diagram%22
--
Scott G. Hall
Raleigh, NC, USA
ph. 919-624-5973
[9]Scott at HallComm-Inc.Com
References
Visible links
1. http://www.academypublication.com/issues/past/jltr/vol01/06/29.pdf
2. http://www.academypublication.com/issues/past/jltr/vol01/06/29.pdf
3. https://linguistics.stackexchange.com/questions/9706/drawing-tree-diagrams-of-ambiguous-sentences-generated-by-a-cfg
4. https://linguistics.stackexchange.com/questions/9706/drawing-tree-diagrams-of-ambiguous-sentences-generated-by-a-cfg
5. http://www.cs.man.ac.uk/%7Epjj/bnf/bnf.html
6. http://www.cs.man.ac.uk/%7Epjj/bnf/bnf.html
7. http://primepuzzle.com/tp2/syntax-diagrams.html
8. https://www.google.com/search?q=%22syntax+diagram%22
9. mailto:Scott at hallcomm-inc.com
More information about the TriZPUG
mailing list