Home | Download | News | Wiki | About ANTLR | Feedback | Support | Bugs


Latest version is 2.7.7.
Download now! »

Download
» Home
» Download
» News
»Using ANTLR
» Documentation
» Wiki
» FAQ
» Articles
» Grammars
» File Sharing
» Code API
» Tech Support
» Bug Tracking
»About ANTLR
» What is ANTLR
» Why use ANTLR
» Showcase
» Testimonials
» Getting Started
» Software License
» ANTLR WebLogs
» ANTLR Workshops
»StringTemplate
»TML
»PCCTS
»Feedback
»Credits
»Contact


Support StringTemplate, ANTLR Project by making a donation! Terence often pays for things like the antlr.org server, conference travel, and this site design (that alone cost US$1000). Buy him a beer and pizza remotely ;)

Search



GrammarAnalyzer


antlr
Interface GrammarAnalyzer

All Known Subinterfaces:
LLkGrammarAnalyzer
All Known Implementing Classes:
LLkAnalyzer

public interface GrammarAnalyzer

A GrammarAnalyzer computes lookahead from Grammar (which contains a grammar symbol table) and can then answer questions about the grammar. To access the RuleBlock for a rule name, the grammar symbol table is consulted. There should be no distinction between static & dynamic analysis. In other words, some of the easy analysis can be done statically and then the part that is hard statically can be deferred to parse-time. Interestingly, computing LL(k) for k>1 lookahead statically is O(|T|^k) where T is the grammar vocabulary, but, is O(k) at run-time (ignoring the large constant associated with the size of the grammar). In English, the difference can be described as "find the set of all possible k-sequences of input" versus "does this specific k-sequence match?".


Field Summary
static int LOOKAHEAD_DEPTH_INIT
           
static int NONDETERMINISTIC
          The epsilon token type is an imaginary type used during analysis.
 

Field Detail

NONDETERMINISTIC

public static final int NONDETERMINISTIC
The epsilon token type is an imaginary type used during analysis. It indicates an incomplete look() computation. Must be kept consistent with Token constants to be between MIN_USER_TYPE and INVALID_TYPE.

See Also:
Constant Field Values

LOOKAHEAD_DEPTH_INIT

public static final int LOOKAHEAD_DEPTH_INIT
See Also:
Constant Field Values