LogiXpr
Loading...
Searching...
No Matches
Functions
Parser functions

Functions for parsing expressions. More...

Functions

std::vector< std::string > tokenize (std::string expression)
 Tokenize the expression.
 
bool parse (std::string expression, std::shared_ptr< Expression > &root)
 Parse the expression and convert it to an abstract syntax tree.
 

Detailed Description

Functions for parsing expressions.

Function Documentation

◆ parse()

bool parse ( std::string  expression,
std::shared_ptr< Expression > &  root 
)

Parse the expression and convert it to an abstract syntax tree.

Parameters
expressionexpression to be parsed
rootto the root of the abstract syntax tree
Returns
bool of whether the expression was parsed successfully

Definition at line 31 of file parser.cpp.

◆ tokenize()

std::vector< std::string > tokenize ( std::string  expression)

Tokenize the expression.

Parameters
expressionexpression to be tokenized
Returns
string vector of tokens

Definition at line 8 of file parser.cpp.