MCPcopy Create free account
hub / github.com/OGRECave/ogre-next / _generateAST

Method _generateAST

OgreMain/src/OgreScriptCompiler.cpp:363–388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

361 }
362
363 AbstractNodeListPtr ScriptCompiler::_generateAST( const String &str, const String &source,
364 bool doImports, bool doObjects, bool doVariables )
365 {
366 // Clear the past errors
367 mErrors.clear();
368
369 ScriptLexer lexer;
370 ScriptParser parser;
371 ConcreteNodeListPtr cst = parser.parse( lexer.tokenize( str ), source );
372
373 // Call the listener to intercept CST
374 if( mListener )
375 mListener->preConversion( this, cst );
376
377 // Convert our nodes to an AST
378 AbstractNodeListPtr ast = convertToAST( cst );
379
380 if( ast && doImports )
381 processImports( ast );
382 if( ast && doObjects )
383 processObjects( ast.get(), ast );
384 if( ast && doVariables )
385 processVariables( ast.get() );
386
387 return ast;
388 }
389
390 bool ScriptCompiler::_compile( AbstractNodeListPtr nodes, const String &group, bool doImports,
391 bool doObjects, bool doVariables )

Callers

nothing calls this directly

Calls 5

tokenizeMethod · 0.80
preConversionMethod · 0.80
clearMethod · 0.45
parseMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected