@Override protected void genRecognizerFile(Tool tool, CodeGenerator generator, Grammar grammar, ST outputFileST) throws IOException { if (!grammar.getGrammarIsRoot()) { Grammar rootGrammar = grammar.composite.getRootGrammar(); String actionScope = grammar.getDefaultActionScope(grammar.type); Map<String, Object> actions = rootGrammar.getActions().get(actionScope); Object rootNamespace = actions != null ? actions.get("namespace") : null; if (actions != null && rootNamespace != null) { actions = grammar.getActions().get(actionScope); if (actions == null) { actions = new HashMap<String, Object>(); grammar.getActions().put(actionScope, actions); } actions.put("namespace", rootNamespace); } } generator.getTemplates().registerRenderer(String.class, new StringRenderer(generator, this)); super.genRecognizerFile(tool, generator, grammar, outputFileST); }
@Override protected void genRecognizerFile(Tool tool, CodeGenerator generator, Grammar grammar, ST outputFileST) throws IOException { if (!grammar.getGrammarIsRoot()) { Grammar rootGrammar = grammar.composite.getRootGrammar(); String actionScope = grammar.getDefaultActionScope(grammar.type); Map<String, Object> actions = rootGrammar.getActions().get(actionScope); Object rootNamespace = actions != null ? actions.get("namespace") : null; if (actions != null && rootNamespace != null) { actions = grammar.getActions().get(actionScope); if (actions == null) { actions = new HashMap<String, Object>(); grammar.getActions().put(actionScope, actions); } actions.put("namespace", rootNamespace); } } generator.getTemplates().registerRenderer(String.class, new StringRenderer(generator, this)); super.genRecognizerFile(tool, generator, grammar, outputFileST); }
target.genRecognizerFile(tool,this,grammar,outputFileST); if ( templates.isDefined("headerFile") ) { StringTemplate extST = templates.getInstanceOf("headerFileExtension");
target.genRecognizerFile(tool,this,grammar,outputFileST); if ( templates.isDefined("headerFile") ) { StringTemplate extST = templates.getInstanceOf("headerFileExtension");
target.genRecognizerFile(tool,this,grammar,outputFileST); if ( templates.isDefined("headerFile") ) { ST extST = templates.getInstanceOf("headerFileExtension");
target.genRecognizerFile(tool,this,grammar,outputFileST); if ( templates.isDefined("headerFile") ) { ST extST = templates.getInstanceOf("headerFileExtension");