Qore astparser Module 2.3.0
Loading...
Searching...
No Matches
astparser::AstParser Class Reference

AstParser class. More...

#include <QC_AstParser.dox.h>

Public Member Methods

 AstParser::clearDefines ()
 Clear predefined symbols used for conditional parsing.
 
 addDefine (string name)
 Add a predefined symbol used for conditional parsing.
 
 constructor ()
 Creates the AstParser.
 
*list getDiagnostics ()
 Get diagnostics.
 
int getErrorCount ()
 Get parse error count.
 
*AstTree parseFile (string filename)
 Parse file.
 
*AstTree parseString (string str)
 Parse string.
 
 setConditionalParsing (bool enabled)
 Enable or disable conditional parsing.
 
 setDefines (list< auto > names)
 Set predefined symbols used for conditional parsing.
 

Detailed Description

AstParser class.

AstParser is used for parsing an AST tree of a Qore source file.

Since
Qore 0.8.13

Member Function Documentation

◆ addDefine()

astparser::AstParser::addDefine ( string  name)

Add a predefined symbol used for conditional parsing.

Parameters
namesymbol name

◆ getDiagnostics()

*list astparser::AstParser::getDiagnostics ( )

Get diagnostics.

Returns
list of diagnostic hashes

◆ getErrorCount()

int astparser::AstParser::getErrorCount ( )

Get parse error count.

Returns
error count

◆ parseFile()

*AstTree astparser::AstParser::parseFile ( string  filename)

Parse file.

Parameters
filenamefile's name including path
Returns
parsed AST tree

◆ parseString()

*AstTree astparser::AstParser::parseString ( string  str)

Parse string.

Parameters
strstring with code
Returns
parsed AST tree

◆ setConditionalParsing()

astparser::AstParser::setConditionalParsing ( bool  enabled)

Enable or disable conditional parsing.

When enabled, conditional directives are evaluated and inactive branches are skipped.

◆ setDefines()

astparser::AstParser::setDefines ( list< auto >  names)

Set predefined symbols used for conditional parsing.

Parameters
nameslist of symbol names

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