MXVM 1.8.1
Virtual Machine, Compiler, and Pascal Frontend
Loading...
Searching...
No Matches
expr_parser Namespace Reference

Classes

struct  ExprToken
 A single expression token holding its type and optional numeric value. More...
class  ExprLexer
 Lexer for constant integer expressions. More...
class  ExprParser
 Recursive-descent parser and evaluator for constant integer expressions. More...

Enumerations

enum class  ExprTokenType {
  END , NUMBER , PLUS , MINUS ,
  MUL , DIV , MOD , LPAREN ,
  RPAREN , PLUSEQ , MINUSEQ , XOR ,
  OR , AND , LOGICAL_AND , LOGICAL_OR ,
  NOT , EQ , NEQ , GT ,
  GTE , LT , LTE , VARIABLE
}
 Token types for the constant expression parser. More...

Variables

std::unordered_map< std::string, uint64_t > vars
 Global variable map for the expression evaluator.

Enumeration Type Documentation

◆ ExprTokenType

enum class expr_parser::ExprTokenType
strong

Token types for the constant expression parser.

Enumerator
END 

end of expression

NUMBER 

numeric literal

PLUS 

'+'

MINUS 

'-'

MUL 

'*'

DIV 

'/'

MOD 

''

LPAREN 

'('

RPAREN 

')'

PLUSEQ 

'+='

MINUSEQ 

'-='

XOR 

'^'

OR 

'|'

AND 

'&'

LOGICAL_AND 

'&&'

LOGICAL_OR 

'||'

NOT 

'!'

EQ 

'=='

NEQ 

'!='

GT 

'>'

GTE 

'>='

LT 

'<'

LTE 

'<='

VARIABLE 

named variable reference

Definition at line 16 of file expr.hpp.

Variable Documentation

◆ vars

std::unordered_map<std::string, uint64_t> expr_parser::vars
inline

Global variable map for the expression evaluator.

Definition at line 50 of file expr.hpp.

Referenced by expr_parser::ExprParser::parseFactor().