Top-down parsing - Wikipedia, the free encyclopedia
Top-down parsing is a strategy of analyzing unknown data relationships by hypothesizing general parse tree structures and then considering whether the known fundamental structures are compatible with...
en.wikipedia.org/wiki/Top-down_parsing
The major class of grammars used for top-down parsing is the class of LL(1) grammars. LL(1) means that the parser we build from the grammar is processing the input string from left to right (that's the first L) using leftmost derivations (the second L). This is exactly what the parsers we wish to design shall do.
www.cs.uky.edu/~lewis/essays/compilers/td-parse.html
Note that technically we are no longer designing pushdown machines. Actually we have designed a top-down parser. The difference is that parsers can advance along the input string (or not) as they desire. But we should note that they still are really pushdown automata.
www.cs.uky.edu/~lewis/essays/compilers/ll-lang.html
In the early seventies, Vaughan Pratt published an elegant improvement to recursive-descent in his paper Top-down Operator Precedence. ... Note that most of the above is general-purpose plumbing; given the helper functions, the actual parser definition boils down to the following six lines:
effbot.org/zone/simple-top-down-parsing.htm effbot.org/zone/simple-top-down-parsing.htm
To introduce two naive top down parsing/recognition algorithms, one depth-first, the other breadth-first. ... To give the top-down depth-first recognition algorithm an efficient implementation in Prolog. ... To extend this recognizer to a parser.
cs.union.edu/~striegnk/courses/nlp-with-prolog/html/nod... cs.union.edu/~striegnk/courses/nlp-with-prolog/html/node44.html
ANTLR v3 has a sophisticated debug event mechanism that allows ANTLRWorks to follow along as a parser processes input. ANTLR v3 includes a well-defined protocol for communicating with remote parsers so ANTLRWorks can actually connect to a parser generated in any language with a socket library.
www.antlr.org/works/index.html
JavaCC - Wikipedia, the free encyclopedia
JavaCC (Java Compiler Compiler) is an open source parser generator for the Java programming language. JavaCC is similar to Yacc in that it generates a parser for a formal grammar provided in EBNF not...
en.wikipedia.org/wiki/JavaCC
Top-down rules in Prolog ... For a parser, we need to be able to build a representation of the structure of sentences. In DCGs this is easy: we simply add an extra argument that is instantiated to the syntactic structure.
www.cs.bham.ac.uk/~pjh/sem1a5/pt3/pt3_dcg.html
Example 2 shows the the parser generator converting this BNF into tables (or a Case statement). The form of the tables depends upon whether the generated parser is a top-down parser or bottom-up parser. Top-down parsers are easy to generate;
www.cs.wpi.edu/~kal/PLT/PLT4.1.html
One example is a JSON parser, the first version of which took about an hour to write, and which resulted in about 60 lines of JSON-specific code (30 lines for the parser definitions, 30 lines for the tokenizer), and 120 lines in total (including the parser framework, that is).
effbot.org/zone/tdop-json.htm
Related Topics
Definitions