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

Classes

class  XParser
 Base parser providing token-stream navigation. More...
struct  Scope
 A single scope level, tracking declared identifiers by category. More...
class  TPValidator
 Semantic validator for Pascal programs. More...

Enumerations

enum class  Keywords {
  AND , ARRAY , BEGIN , CASE ,
  CONST , DIV , DO , DOWNTO ,
  ELSE , END , FILE , FOR ,
  FUNCTION , GOTO , IF , IN ,
  LABEL , MOD , NIL , NOT ,
  OF , OR , PACKED , PROCEDURE ,
  PROGRAM , RECORD , REPEAT , SET ,
  THEN , TO , TYPE , UNTIL ,
  VAR , WHILE , WITH
}
 Standard Pascal reserved keyword enumeration. More...

Functions

static bool ciEquals (const std::string &a, const std::string &b)
 Case-insensitive string equality comparison.

Variables

static const char * key_str []
 String representations of Keywords values, indexed by enum ordinal.
static const std::unordered_set< std::string > pascal_keywords

Enumeration Type Documentation

◆ Keywords

enum class mxx::Keywords
strong

Standard Pascal reserved keyword enumeration.

Enumerator
AND 
ARRAY 
BEGIN 
CASE 
CONST 
DIV 
DO 
DOWNTO 
ELSE 
END 
FILE 
FOR 
FUNCTION 
GOTO 
IF 
IN 
LABEL 
MOD 
NIL 
NOT 
OF 
OR 
PACKED 
PROCEDURE 
PROGRAM 
RECORD 
REPEAT 
SET 
THEN 
TO 
TYPE 
UNTIL 
VAR 
WHILE 
WITH 

Definition at line 12 of file types.hpp.

Function Documentation

◆ ciEquals()

bool mxx::ciEquals ( const std::string & a,
const std::string & b )
static

Case-insensitive string equality comparison.

Parameters
aFirst string
bSecond string
Returns
true if a and b are equal ignoring ASCII case

Definition at line 67 of file validator.cpp.

Referenced by mxx::TPValidator::match(), and mxx::TPValidator::peekIs().

Variable Documentation

◆ key_str

const char* mxx::key_str[]
static

String representations of Keywords values, indexed by enum ordinal.

Definition at line 51 of file types.hpp.

◆ pascal_keywords

const std::unordered_set<std::string> mxx::pascal_keywords
static
Initial value:
= {
"program", "unit", "interface", "implementation",
"uses", "var", "const", "type", "procedure", "function", "begin", "end",
"if", "then", "else", "while", "do", "for", "to", "downto", "repeat", "until",
"case", "of", "with", "goto", "label", "exit", "break", "continue",
"nil", "new", "dispose", "setlength", "high", "low",
"writeln", "write", "readln", "read", "seed_random", "rand_number",
"div", "mod", "and", "or", "not", "in",
"integer", "real", "boolean", "char", "byte", "word", "longint", "shortint",
"smallint", "cardinal", "string", "text", "double", "single", "extended",
"comp", "currency", "ptr", "pointer", "array", "record", "set",
"packed", "file", "text",
"assign", "reset", "rewrite", "append", "close", "eof", "eoln",
"include", "exclude"}

Definition at line 1373 of file validator.cpp.

Referenced by mxx::TPValidator::isPascalKeyword().