umbrello: DebugLanguageParserHelper< SessionT, TokenStreamT, TokenT, LexerT, StartAstT, DebugVisitorT, TokenTextT > Class Template Reference

umbrello 2.38.2 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Private Member Functions | Private Attributes | List of all members
DebugLanguageParserHelper< SessionT, TokenStreamT, TokenT, LexerT, StartAstT, DebugVisitorT, TokenTextT > Class Template Reference

## 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
StartAstT * | ast () 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
StartAstT * | m_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

  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.

## Constructor & Destructor Documentation

## ◆ DebugLanguageParserHelper()

template<class SessionT , class TokenStreamT , class TokenT , class LexerT , class StartAstT , class DebugVisitorT , TokenTextFunc TokenTextT>

DebugLanguageParserHelper< SessionT, TokenStreamT, TokenT, LexerT, StartAstT, DebugVisitorT, TokenTextT >::DebugLanguageParserHelper | ( | const bool | printAst,
|  | const bool | printTokens
| ) |  |
| inline

## Member Function Documentation

## ◆ ast()

template<class SessionT , class TokenStreamT , class TokenT , class LexerT , class StartAstT , class DebugVisitorT , TokenTextFunc TokenTextT>

StartAstT * DebugLanguageParserHelper< SessionT, TokenStreamT, TokenT, LexerT, StartAstT, DebugVisitorT, TokenTextT >::ast | ( |  | ) | const
| inline

## ◆ contents()

template<class SessionT , class TokenStreamT , class TokenT , class LexerT , class StartAstT , class DebugVisitorT , TokenTextFunc TokenTextT>

QString DebugLanguageParserHelper< SessionT, TokenStreamT, TokenT, LexerT, StartAstT, DebugVisitorT, TokenTextT >::contents | ( |  | ) | const
| inline

## ◆ dependencies()

template<class SessionT , class TokenStreamT , class TokenT , class LexerT , class StartAstT , class DebugVisitorT , TokenTextFunc TokenTextT>

QStringList DebugLanguageParserHelper< SessionT, TokenStreamT, TokenT, LexerT, StartAstT, DebugVisitorT, TokenTextT >::dependencies | ( |  | ) | const
| inline

## ◆ parseCode()

template<class SessionT , class TokenStreamT , class TokenT , class LexerT , class StartAstT , class DebugVisitorT , TokenTextFunc TokenTextT>

bool DebugLanguageParserHelper< SessionT, TokenStreamT, TokenT, LexerT, StartAstT, DebugVisitorT, TokenTextT >::parseCode | ( | const QString & | code | ) |
| inline

parse code directly

## ◆ parseFile()

template<class SessionT , class TokenStreamT , class TokenT , class LexerT , class StartAstT , class DebugVisitorT , TokenTextFunc TokenTextT>

bool DebugLanguageParserHelper< SessionT, TokenStreamT, TokenT, LexerT, StartAstT, DebugVisitorT, TokenTextT >::parseFile | ( | const QString & | fileName | ) |
| inline

parse contents of a file

## ◆ printToken()

template<class SessionT , class TokenStreamT , class TokenT , class LexerT , class StartAstT , class DebugVisitorT , TokenTextFunc TokenTextT>

void DebugLanguageParserHelper< SessionT, TokenStreamT, TokenT, LexerT, StartAstT, DebugVisitorT, TokenTextT >::printToken | ( | int | token,
|  | const LexerT & | lexer
| ) |  | const
| inlineprivate

## ◆ runSession()

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

## ◆ setFed()

template<class SessionT , class TokenStreamT , class TokenT , class LexerT , class StartAstT , class DebugVisitorT , TokenTextFunc TokenTextT>

void DebugLanguageParserHelper< SessionT, TokenStreamT, TokenT, LexerT, StartAstT, DebugVisitorT, TokenTextT >::setFed | ( | bool | state | ) |
| inline

## ◆ tokenStream()

template<class SessionT , class TokenStreamT , class TokenT , class LexerT , class StartAstT , class DebugVisitorT , TokenTextFunc TokenTextT>

Php::TokenStream * DebugLanguageParserHelper< SessionT, TokenStreamT, TokenT, LexerT, StartAstT, DebugVisitorT, TokenTextT >::tokenStream | ( |  | ) |
| inline

## ◆ wasFed()

template<class SessionT , class TokenStreamT , class TokenT , class LexerT , class StartAstT , class DebugVisitorT , TokenTextFunc TokenTextT>

bool DebugLanguageParserHelper< SessionT, TokenStreamT, TokenT, LexerT, StartAstT, DebugVisitorT, TokenTextT >::wasFed | ( |  | ) |
| inline

## Member Data Documentation

## ◆ m_ast

template<class SessionT , class TokenStreamT , class TokenT , class LexerT , class StartAstT , class DebugVisitorT , TokenTextFunc TokenTextT>

StartAstT* DebugLanguageParserHelper< SessionT, TokenStreamT, TokenT, LexerT, StartAstT, DebugVisitorT, TokenTextT >::m_ast
| private

## ◆ m_dependencies

template<class SessionT , class TokenStreamT , class TokenT , class LexerT , class StartAstT , class DebugVisitorT , TokenTextFunc TokenTextT>

QStringList DebugLanguageParserHelper< SessionT, TokenStreamT, TokenT, LexerT, StartAstT, DebugVisitorT, TokenTextT >::m_dependencies
| private

## ◆ m_isFed

template<class SessionT , class TokenStreamT , class TokenT , class LexerT , class StartAstT , class DebugVisitorT , TokenTextFunc TokenTextT>

bool DebugLanguageParserHelper< SessionT, TokenStreamT, TokenT, LexerT, StartAstT, DebugVisitorT, TokenTextT >::m_isFed
| private

## ◆ m_printAst

template<class SessionT , class TokenStreamT , class TokenT , class LexerT , class StartAstT , class DebugVisitorT , TokenTextFunc TokenTextT>

const bool DebugLanguageParserHelper< SessionT, TokenStreamT, TokenT, LexerT, StartAstT, DebugVisitorT, TokenTextT >::m_printAst
| private

## ◆ m_printTokens

template<class SessionT , class TokenStreamT , class TokenT , class LexerT , class StartAstT , class DebugVisitorT , TokenTextFunc TokenTextT>

const bool DebugLanguageParserHelper< SessionT, TokenStreamT, TokenT, LexerT, StartAstT, DebugVisitorT, TokenTextT >::m_printTokens
| private

## ◆ m_session

template<class SessionT , class TokenStreamT , class TokenT , class LexerT , class StartAstT , class DebugVisitorT , TokenTextFunc TokenTextT>

SessionT DebugLanguageParserHelper< SessionT, TokenStreamT, TokenT, LexerT, StartAstT, DebugVisitorT, TokenTextT >::m_session
| private

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

- umbrello/codeimport/phpimport.cpp