Uses of Class
org.antlr.v4.tool.Grammar
-
-
Uses of Grammar in org.antlr.v4
Methods in org.antlr.v4 that return Grammar Modifier and Type Method Description GrammarTool. createGrammar(GrammarRootAST ast)Given the raw AST of a grammar, create a grammar object associated with the AST.GrammarTool. loadGrammar(String fileName)Convenience method to load and process an ANTLR grammar.GrammarTool. loadImportedGrammar(Grammar g, GrammarAST nameNode)Try current dir then dir of g then lib dirMethods in org.antlr.v4 with parameters of type Grammar Modifier and Type Method Description booleanTool. checkForRuleIssues(Grammar g)Important enough to avoid multiple definitions that we do very early, right after AST construction.voidTool. generateATNs(Grammar g)static StringTool. generateInterpreterData(Grammar g)FileTool. getImportedGrammarFile(Grammar g, String fileName)WriterTool. getOutputFileWriter(Grammar g, String fileName)This method is used by all code generators to create new output files.GrammarTool. loadImportedGrammar(Grammar g, GrammarAST nameNode)Try current dir then dir of g then lib dirvoidTool. process(Grammar g, boolean gencode)To process a grammar, we load all of its imported grammars into subordinate grammar objects.voidTool. processNonCombinedGrammar(Grammar g, boolean gencode)protected voidTool. writeDOTFile(Grammar g, String name, String dot)protected voidTool. writeDOTFile(Grammar g, Rule r, String dot) -
Uses of Grammar in org.antlr.v4.analysis
Fields in org.antlr.v4.analysis declared as Grammar Modifier and Type Field Description GrammarAnalysisPipeline. gGrammarLeftRecursiveRuleTransformer. gMethods in org.antlr.v4.analysis with parameters of type Grammar Modifier and Type Method Description RuleASTLeftRecursiveRuleTransformer. parseArtificialRule(Grammar g, String ruleText)Constructors in org.antlr.v4.analysis with parameters of type Grammar Constructor Description AnalysisPipeline(Grammar g)LeftRecursionDetector(Grammar g, ATN atn)LeftRecursiveRuleTransformer(GrammarRootAST ast, Collection<Rule> rules, Grammar g) -
Uses of Grammar in org.antlr.v4.automata
Fields in org.antlr.v4.automata declared as Grammar Modifier and Type Field Description GrammarParserATNFactory. gMethods in org.antlr.v4.automata with parameters of type Grammar Modifier and Type Method Description static RangeBorderCharactersDataRangeBorderCharactersData. getAndCheckCharactersData(int from, int to, Grammar grammar, org.antlr.runtime.tree.CommonTree tree, boolean reportRangeContainsNotImpliedCharacters)static voidATNOptimizer. optimize(Grammar g, ATN atn)Constructors in org.antlr.v4.automata with parameters of type Grammar Constructor Description ATNPrinter(Grammar g, ATNState start)ParserATNFactory(Grammar g) -
Uses of Grammar in org.antlr.v4.codegen
Fields in org.antlr.v4.codegen declared as Grammar Modifier and Type Field Description GrammarCodeGenerator. gGrammarDefaultOutputModelFactory. gMethods in org.antlr.v4.codegen that return Grammar Modifier and Type Method Description GrammarDefaultOutputModelFactory. getGrammar()GrammarOutputModelController. getGrammar()GrammarOutputModelFactory. getGrammar()Methods in org.antlr.v4.codegen with parameters of type Grammar Modifier and Type Method Description static CodeGeneratorCodeGenerator. create(Grammar g)static CodeGeneratorCodeGenerator. create(Tool tool, Grammar g, String language)protected voidTarget. genFile(Grammar g, org.stringtemplate.v4.ST outputFileST, String fileName)StringTarget. getTokenTypeAsTargetLabel(Grammar g, int ttype)Get a meaningful name for a token type useful during code generation.String[]Target. getTokenTypesAsTargetLabels(Grammar g, int[] ttypes)Constructors in org.antlr.v4.codegen with parameters of type Grammar Constructor Description CodeGenPipeline(Grammar g, CodeGenerator gen) -
Uses of Grammar in org.antlr.v4.codegen.model
Methods in org.antlr.v4.codegen.model with parameters of type Grammar Modifier and Type Method Description Map<String,Action>OutputFile. buildNamedActions(Grammar g)Map<String,Action>OutputFile. buildNamedActions(Grammar g, Predicate<ActionAST> filter) -
Uses of Grammar in org.antlr.v4.codegen.target
Methods in org.antlr.v4.codegen.target with parameters of type Grammar Modifier and Type Method Description protected voidGoTarget. genFile(Grammar g, org.stringtemplate.v4.ST outputFileST, String fileName) -
Uses of Grammar in org.antlr.v4.gui
Subclasses of Grammar in org.antlr.v4.gui Modifier and Type Class Description protected static classInterpreter.IgnoreTokenVocabGrammarConstructors in org.antlr.v4.gui with parameters of type Grammar Constructor Description IgnoreTokenVocabGrammar(String fileName, String grammarText, Grammar tokenVocabSource, ANTLRToolListener listener) -
Uses of Grammar in org.antlr.v4.parse
Fields in org.antlr.v4.parse declared as Grammar Modifier and Type Field Description GrammarBlockSetTransformer. gGrammarGrammarToken. gprotected GrammarTokenVocabParser. gMethods in org.antlr.v4.parse with parameters of type Grammar Modifier and Type Method Description static Pair<Integer,Integer>ScopeParser. _parsePostfixDecl(Attribute attr, String decl, ActionAST a, Grammar g)static Pair<Integer,Integer>ScopeParser. _parsePrefixDecl(Attribute attr, String decl, ActionAST a, Grammar g)static AttributeDictScopeParser. parse(ActionAST action, String s, char separator, Grammar g)static AttributeScopeParser. parseAttributeDef(ActionAST action, Pair<String,Integer> decl, Grammar g)For decls like "String foo" or "char *foo32[]" compute the ID and type declarations.static AttributeDictScopeParser. parseTypedArgList(ActionAST action, String s, Grammar g)Given an arg or retval scope definition list likeConstructors in org.antlr.v4.parse with parameters of type Grammar Constructor Description BlockSetTransformer(org.antlr.runtime.tree.TreeNodeStream input, Grammar g)GrammarToken(Grammar g, org.antlr.runtime.Token oldToken)TokenVocabParser(Grammar g) -
Uses of Grammar in org.antlr.v4.semantics
Fields in org.antlr.v4.semantics declared as Grammar Modifier and Type Field Description GrammarActionSniffer. gGrammarAttributeChecks. gGrammarBasicSemanticChecks. gGrammarRuleCollector. gwhich grammar are we checkingGrammarSemanticPipeline. gGrammarSymbolCollector. gwhich grammar are we checkingMethods in org.antlr.v4.semantics with parameters of type Grammar Modifier and Type Method Description static voidAttributeChecks. checkAllAttributeExpressions(Grammar g)voidSymbolChecks. checkForModeConflicts(Grammar g)voidSymbolChecks. checkForQualifiedRuleIssues(Grammar g, List<GrammarAST> qualifiedRuleRefs)voidSymbolChecks. checkForUnreachableTokens(Grammar g)Algorithm steps: 1.voidSymbolChecks. checkRuleArgs(Grammar g, List<GrammarAST> rulerefs)static Map<Rule,Set<Rule>>UseDefAnalyzer. getRuleDependencies(Grammar g)Find all rules reachable from r directly or indirectly for all r in gstatic Map<Rule,Set<Rule>>UseDefAnalyzer. getRuleDependencies(Grammar g, Collection<Rule> rules)static voidUseDefAnalyzer. trackTokenRuleRefsInActions(Grammar g)Constructors in org.antlr.v4.semantics with parameters of type Grammar Constructor Description ActionSniffer(Grammar g, Rule r, Alternative alt, ActionAST node, org.antlr.runtime.Token actionToken)AttributeChecks(Grammar g, Rule r, Alternative alt, ActionAST node, org.antlr.runtime.Token actionToken)BasicSemanticChecks(Grammar g, RuleCollector ruleCollector)RuleCollector(Grammar g)SemanticPipeline(Grammar g)SymbolChecks(Grammar g, SymbolCollector collector)SymbolCollector(Grammar g) -
Uses of Grammar in org.antlr.v4.tool
Subclasses of Grammar in org.antlr.v4.tool Modifier and Type Class Description classLexerGrammarFields in org.antlr.v4.tool declared as Grammar Modifier and Type Field Description GrammarANTLRMessage. gprotected GrammarBuildDependencyGenerator. gprotected GrammarGrammarParserInterpreter. gThe grammar associated with this interpreter.GrammarGrammarTransformPipeline. gGrammarRule. gIn which grammar does this rule live?protected GrammarDOTGenerator. grammarGrammarLexerGrammar. implicitLexerOwnerThe grammar from which this lexer grammar was derived (if implicit)GrammarGrammar. originalGrammarIf this is an extracted/implicit lexer, we point at original grammarGrammarGrammar. parentIf we're imported, who imported us? If null, implies grammar is rootFields in org.antlr.v4.tool with type parameters of type Grammar Modifier and Type Field Description List<Grammar>Grammar. importedGrammarsMethods in org.antlr.v4.tool that return Grammar Modifier and Type Method Description GrammarGrammar. getImportedGrammar(String name)Return grammar directly imported by this grammarGrammarGrammar. getOutermostGrammar()Return the grammar that imported us and our parents.static GrammarGrammar. load(String fileName)convenience method for Tool.loadGrammar()Methods in org.antlr.v4.tool that return types with arguments of type Grammar Modifier and Type Method Description List<Grammar>Grammar. getAllImportedGrammars()Get list of all imports from all grammars in the delegate subtree of g.List<Grammar>Grammar. getGrammarAncestors()Return list of imported grammars from root down to our parent.List<Grammar>Grammar. getImportedGrammars()Methods in org.antlr.v4.tool with parameters of type Grammar Modifier and Type Method Description static voidGrammarTransformPipeline. augmentTokensWithOriginalPosition(Grammar g, GrammarAST tree)static ParserInterpreterGrammarParserInterpreter. deriveTempParserInterpreter(Grammar g, Parser originalParser, TokenStream tokens)Derive a new parser from an old one that has knowledge of the grammar.GrammarRootASTGrammarTransformPipeline. extractImplicitLexer(Grammar combinedGrammar)Build lexer grammar from combined grammar that looks like: (COMBINED_GRAMMAR A (tokens { X (= Y 'y')) (OPTIONS (= x 'y')) (@ members {foo}) (@ lexer header {package jj;}) (RULES (RULE .+))) Move rules and actions to new tree, don't dup.static List<ParserRuleContext>GrammarParserInterpreter. getAllPossibleParseTrees(Grammar g, Parser originalParser, TokenStream tokens, int decision, BitSet alts, int startIndex, int stopIndex, int startRuleIndex)Given an ambiguous parse information, return the list of ambiguous parse trees.static List<ParserRuleContext>GrammarParserInterpreter. getLookaheadParseTrees(Grammar g, ParserInterpreter originalParser, TokenStream tokens, int startRuleIndex, int decision, int startIndex, int stopIndex)Return a list of parse trees, one for each alternative in a decision given the same input.voidGrammar. importVocab(Grammar importG)voidGrammarTransformPipeline. integrateImportedGrammars(Grammar rootGrammar)Merge all the rules, token definitions, and named actions from imported grammars into the root grammar tree.static voidGrammarTransformPipeline. setGrammarPtr(Grammar g, GrammarAST tree)Utility visitor that sets grammar ptr in each nodeConstructors in org.antlr.v4.tool with parameters of type Grammar Constructor Description BuildDependencyGenerator(Tool tool, Grammar g)DOTGenerator(Grammar grammar)This aspect is associated with a grammarGrammar(String fileName, String grammarText, Grammar tokenVocabSource, ANTLRToolListener listener)For testing; builds trees, does sem analGrammarParserInterpreter(Grammar g, String grammarFileName, Vocabulary vocabulary, Collection<String> ruleNames, ATN atn, TokenStream input)GrammarParserInterpreter(Grammar g, ATN atn, TokenStream input)GrammarTransformPipeline(Grammar g, Tool tool)LabelElementPair(Grammar g, GrammarAST label, GrammarAST element, int labelOp)LeftRecursiveRule(Grammar g, String name, RuleAST ast)Rule(Grammar g, String name, RuleAST ast, int numberOfAlts)Rule(Grammar g, String name, RuleAST ast, int numberOfAlts, String lexerMode, boolean caseInsensitive) -
Uses of Grammar in org.antlr.v4.tool.ast
Fields in org.antlr.v4.tool.ast declared as Grammar Modifier and Type Field Description GrammarGrammarAST. gFor error msgs, nice to know which grammar this AST lives in
-