Uses of Class
org.antlr.v4.tool.Grammar
Packages that use Grammar
Package
Description
-
Uses of Grammar in org.antlr.mojo.antlr4
Methods in org.antlr.mojo.antlr4 with parameters of type Grammar -
Uses of Grammar in org.antlr.v4
Fields in org.antlr.v4 with type parameters of type GrammarMethods in org.antlr.v4 that return GrammarModifier and TypeMethodDescriptionTool.createGrammar(GrammarRootAST ast) Given the raw AST of a grammar, create a grammar object associated with the AST.Tool.loadGrammar(String fileName) Convenience method to load and process an ANTLR grammar.Tool.loadImportedGrammar(Grammar g, GrammarAST nameNode) Try current dir then dir of g then lib dirMethods in org.antlr.v4 with parameters of type GrammarModifier and TypeMethodDescriptionbooleanTool.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) Tool.getImportedGrammarFile(Grammar g, String fileName) Tool.getOutputFileWriter(Grammar g, String fileName) This method is used by all code generators to create new output files.Tool.loadImportedGrammar(Grammar g, GrammarAST nameNode) Try current dir then dir of g then lib dirvoidTo 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 GrammarModifier and TypeFieldDescriptionAnalysisPipeline.g(package private) GrammarLeftRecursionDetector.gLeftRecursiveRuleTransformer.gMethods in org.antlr.v4.analysis with parameters of type GrammarModifier and TypeMethodDescriptionLeftRecursiveRuleTransformer.parseArtificialRule(Grammar g, String ruleText) Constructors in org.antlr.v4.analysis with parameters of type GrammarModifierConstructorDescriptionLeftRecursionDetector(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 GrammarModifier and TypeFieldDescription(package private) GrammarATNPrinter.gfinal GrammarParserATNFactory.gMethods in org.antlr.v4.automata with parameters of type GrammarModifier and TypeMethodDescriptionstatic RangeBorderCharactersDataRangeBorderCharactersData.getAndCheckCharactersData(int from, int to, Grammar grammar, org.antlr.runtime.tree.CommonTree tree, boolean reportRangeContainsNotImpliedCharacters) static voidprivate static voidATNOptimizer.optimizeSets(Grammar g, ATN atn) Constructors in org.antlr.v4.automata with parameters of type Grammar -
Uses of Grammar in org.antlr.v4.codegen
Fields in org.antlr.v4.codegen declared as GrammarModifier and TypeFieldDescriptionfinal GrammarCodeGenerator.g(package private) final GrammarCodeGenPipeline.gfinal GrammarDefaultOutputModelFactory.gMethods in org.antlr.v4.codegen that return GrammarModifier and TypeMethodDescriptionDefaultOutputModelFactory.getGrammar()OutputModelController.getGrammar()OutputModelFactory.getGrammar()Methods in org.antlr.v4.codegen with parameters of type GrammarModifier and TypeMethodDescriptionstatic CodeGeneratorstatic CodeGeneratorprotected voidTarget.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 GrammarModifierConstructorDescriptionprivateCodeGenerator(Tool tool, Grammar g, String language) 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 -
Uses of Grammar in org.antlr.v4.codegen.target
Methods in org.antlr.v4.codegen.target with parameters of type Grammar -
Uses of Grammar in org.antlr.v4.gui
Subclasses of Grammar in org.antlr.v4.guiConstructors in org.antlr.v4.gui with parameters of type GrammarModifierConstructorDescriptionIgnoreTokenVocabGrammar(String fileName, String grammarText, Grammar tokenVocabSource, ANTLRToolListener listener) -
Uses of Grammar in org.antlr.v4.parse
Fields in org.antlr.v4.parse declared as GrammarModifier and TypeFieldDescriptionBlockSetTransformer.gGrammarToken.gprotected final GrammarTokenVocabParser.gMethods in org.antlr.v4.parse with parameters of type GrammarModifier and TypeMethodDescriptionScopeParser._parsePostfixDecl(Attribute attr, String decl, ActionAST a, Grammar g) ScopeParser._parsePrefixDecl(Attribute attr, String decl, ActionAST a, Grammar g) static AttributeDictstatic AttributeFor 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 GrammarModifierConstructorDescriptionBlockSetTransformer(org.antlr.runtime.tree.TreeNodeStream input, Grammar g) GrammarToken(Grammar g, org.antlr.runtime.Token oldToken) -
Uses of Grammar in org.antlr.v4.semantics
Fields in org.antlr.v4.semantics declared as GrammarModifier and TypeFieldDescriptionActionSniffer.gAttributeChecks.gBasicSemanticChecks.gRuleCollector.gwhich grammar are we checkingSemanticPipeline.g(package private) GrammarSymbolChecks.gSymbolCollector.gwhich grammar are we checkingMethods in org.antlr.v4.semantics with parameters of type GrammarModifier and TypeMethodDescription(package private) voidSemanticPipeline.assignChannelTypes(Grammar g, List<GrammarAST> channelDefs) Assign constant values to custom channels defined in a grammar.(package private) voidSemanticPipeline.assignLexerTokenTypes(Grammar g, List<GrammarAST> tokensDefs) (package private) voidSemanticPipeline.assignTokenTypes(Grammar g, List<GrammarAST> tokensDefs, List<GrammarAST> tokenIDs, List<GrammarAST> terminals) static voidAttributeChecks.checkAllAttributeExpressions(Grammar g) voidSymbolChecks.checkForModeConflicts(Grammar g) private voidSymbolChecks.checkForOverlap(Grammar g, Rule rule1, Rule rule2, List<String> firstTokenStringValues, List<String> secondTokenStringValues) For same rule compare values from next index: TOKEN_WITH_SAME_VALUES: 'asdf' | 'asdf'; For different rules compare from start value: TOKEN1: 'asdf'; TOKEN2: 'asdf';voidSymbolChecks.checkForQualifiedRuleIssues(Grammar g, List<GrammarAST> qualifiedRuleRefs) voidSymbolChecks.checkForUnreachableTokens(Grammar g) Algorithm steps: 1.voidSymbolChecks.checkRuleArgs(Grammar g, List<GrammarAST> rulerefs) UseDefAnalyzer.getRuleDependencies(Grammar g) Find all rules reachable from r directly or indirectly for all r in gUseDefAnalyzer.getRuleDependencies(Grammar g, Collection<Rule> rules) static voidUseDefAnalyzer.trackTokenRuleRefsInActions(Grammar g) Constructors in org.antlr.v4.semantics with parameters of type GrammarModifierConstructorDescriptionActionSniffer(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) SymbolChecks(Grammar g, SymbolCollector collector) -
Uses of Grammar in org.antlr.v4.tool
Subclasses of Grammar in org.antlr.v4.toolFields in org.antlr.v4.tool declared as GrammarModifier and TypeFieldDescriptionANTLRMessage.gprotected GrammarBuildDependencyGenerator.gprotected final GrammarGrammarParserInterpreter.gThe grammar associated with this interpreter.GrammarTransformPipeline.gfinal GrammarRule.gIn which grammar does this rule live?protected GrammarDOTGenerator.grammarLexerGrammar.implicitLexerOwnerThe grammar from which this lexer grammar was derived (if implicit)Grammar.originalGrammarIf this is an extracted/implicit lexer, we point at original grammarGrammar.parentIf we're imported, who imported us? If null, implies grammar is rootFields in org.antlr.v4.tool with type parameters of type GrammarMethods in org.antlr.v4.tool that return GrammarModifier and TypeMethodDescriptionGrammar.getImportedGrammar(String name) Return grammar directly imported by this grammarGrammar.getOutermostGrammar()Return the grammar that imported us and our parents.static Grammarconvenience method for Tool.loadGrammar()Methods in org.antlr.v4.tool that return types with arguments of type GrammarModifier and TypeMethodDescriptionGrammar.getAllImportedGrammars()Get list of all imports from all grammars in the delegate subtree of g.Grammar.getGrammarAncestors()Return list of imported grammars from root down to our parent.Grammar.getImportedGrammars()Methods in org.antlr.v4.tool with parameters of type GrammarModifier and TypeMethodDescriptionstatic 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.GrammarTransformPipeline.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 GrammarModifierConstructorDescriptionBuildDependencyGenerator(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, String lexerMode, boolean caseInsensitive) -
Uses of Grammar in org.antlr.v4.tool.ast
Fields in org.antlr.v4.tool.ast declared as Grammar