Package org.antlr.v4.codegen
Class OutputModelWalker
- java.lang.Object
-
- org.antlr.v4.codegen.OutputModelWalker
-
public class OutputModelWalker extends Object
Convert an output model tree to template hierarchy by walking the output model. Each output model object has a corresponding template of the same name. An output model object can have nested objects. We identify those nested objects by the list of arguments in the template definition. For example, here is the definition of the parser template: Parser(parser, scopes, funcs) ::= <<...>> The first template argument is always the output model object from which this walker will create the template. Any other arguments identify the field names within the output model object of nested model objects. So, in this case, template Parser is saying that output model object Parser has two fields the walker should chase called a scopes and funcs. This simple mechanism means we don't have to include code in every output model object that says how to create the corresponding template.
-
-
Constructor Summary
Constructors Constructor Description OutputModelWalker(Tool tool, org.stringtemplate.v4.STGroup templates)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.stringtemplate.v4.ST
walk(OutputModelObject omo, boolean header)
-
-
-
Constructor Detail
-
OutputModelWalker
public OutputModelWalker(Tool tool, org.stringtemplate.v4.STGroup templates)
-
-
Method Detail
-
walk
public org.stringtemplate.v4.ST walk(OutputModelObject omo, boolean header)
-
-