umbrello 2.39.1
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
Public Member Functions | Private Member Functions | Private Attributes | List of all members
DebugLanguageParserHelper< SessionT, TokenStreamT, TokenT, LexerT, StartAstT, DebugVisitorT, TokenTextT > Class Template Reference
Collaboration diagram for DebugLanguageParserHelper< SessionT, TokenStreamT, TokenT, LexerT, StartAstT, DebugVisitorT, TokenTextT >:

Public Member Functions

 DebugLanguageParserHelper (const bool printAst, const bool printTokens)
 
bool parseFile (const QString &fileName)
 parse contents of a file
 
bool parseCode (const QString &code)
 parse code directly
 
Php::TokenStream * tokenStream ()
 
QString contents () const
 
QStringList dependencies () const
 
StartAstTast () const
 
void setFed (bool state)
 
bool wasFed ()
 

Private Member Functions

bool runSession (const QString &fileName=QString())
 
void printToken (int token, const LexerT &lexer) const
 

Private Attributes

SessionT m_session
 
const bool m_printAst
 
const bool m_printTokens
 
StartAstTm_ast
 
QStringList m_dependencies
 
bool m_isFed
 

Detailed Description

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
SessionTthe parse session for your language.
TokenStreamTthe token stream for your language, based on KDevPG::TokenStreamBase.
TokenTthe token class for your language, based on KDevPG::Token.
LexerTthe Lexer for your language.
StartAstTthe AST node that is returned from SessionT::parse().
DebugVisitorTthe debug visitor for your language.
TokenToTextTfunction pointer to the function that returns a string representation for an integral token.

Constructor & Destructor Documentation

◆ DebugLanguageParserHelper()

Member Function Documentation

◆ ast()

◆ contents()

◆ dependencies()

◆ parseCode()

parse code directly

Here is the call graph for this function:

◆ parseFile()

parse contents of a file

Here is the call graph for this function:

◆ printToken()

Here is the call graph for this function:

◆ runSession()

actually run the parse session

Here is the call graph for this function:

◆ setFed()

◆ tokenStream()

◆ wasFed()

Member Data Documentation

◆ m_ast

◆ m_dependencies

◆ m_isFed

◆ m_printAst

◆ m_printTokens

◆ m_session


The documentation for this class was generated from the following file: