template<class SessionT, class TokenStreamT, class TokenT, class LexerT, class StartAstT, class DebugVisitorT, TokenTextFunc TokenTextT>
class DebugLanguageParserHelper< SessionT, TokenStreamT, TokenT, LexerT, StartAstT, DebugVisitorT, TokenTextT >
This class is a pure helper to use for binaries that you can run on short snippets of test code or whole files and let it print the generated tokens or AST.
It should work fine for any KDevelop-PG-Qt based parser.
- Parameters
-
SessionT | the parse session for your language. |
TokenStreamT | the token stream for your language, based on KDevPG::TokenStreamBase. |
TokenT | the token class for your language, based on KDevPG::Token. |
LexerT | the Lexer for your language. |
StartAstT | the AST node that is returned from SessionT::parse() . |
DebugVisitorT | the debug visitor for your language. |
TokenToTextT | function pointer to the function that returns a string representation for an integral token. |
template<class SessionT , class TokenStreamT , class TokenT , class LexerT , class StartAstT , class DebugVisitorT , TokenTextFunc TokenTextT>
bool DebugLanguageParserHelper< SessionT, TokenStreamT, TokenT, LexerT, StartAstT, DebugVisitorT, TokenTextT >::runSession |
( |
const QString & |
fileName = QString() | ) |
|
|
inlineprivate |
actually run the parse session