|
MXVM 1.8.1
Virtual Machine, Compiler, and Pascal Frontend
|
Classes | |
| class | ASTNode |
| Abstract base class for all AST nodes. More... | |
| class | SectionNode |
| Represents a program section (.data, .code, .module, .object). More... | |
| class | ProgramNode |
| Root AST node representing an entire program or object. More... | |
| class | VariableNode |
| AST node for a variable declaration in a .data section. More... | |
| class | ModuleNode |
| AST node for a module import declaration. More... | |
| class | ObjectNode |
| AST node for an object import declaration. More... | |
| class | InstructionNode |
| AST node representing a single MXVM instruction with its operands. More... | |
| class | LabelNode |
| AST node for a label (or function entry point) in the code section. More... | |
| class | ExpressionNode |
| AST node for a literal expression value. More... | |
| class | CommentNode |
| AST node for a source-level comment. More... | |
| class | ASTVisitor |
| Visitor interface for traversing the AST node hierarchy. More... | |
| class | Function |
| class | Function< R(Args...)> |
| RAII wrapper for dynamically loaded functions via dlopen/dlsym. More... | |
| class | HTMLGen |
| Generates syntax-highlighted HTML output from MXVM source code. More... | |
| class | PasHTMLGen |
| Generates syntax-highlighted HTML output from Pascal (.pas) source code. More... | |
| class | Stack |
| Runtime operand stack for the MXVM interpreter. More... | |
| class | RuntimeFunction |
| Wraps a dynamically loaded native function from a shared library module. More... | |
| class | Base |
| Base class for instruction storage, variables, labels, and external function registrations. More... | |
| class | Program |
| Complete MXVM program: instruction interpreter and native x64 code generator. More... | |
| struct | Operand |
| A single instruction operand (constant value or variable reference). More... | |
| struct | Instruction |
| A complete MXVM instruction with opcode, operands, and optional label. More... | |
| struct | Variable_Value |
| Runtime value storage for a variable. More... | |
| struct | Variable |
| A named variable with type, value, and optional object association. More... | |
| class | Parser |
| Main MXVM parser — tokenizes source, builds AST, and generates intermediate code. More... | |
| struct | ExternalFunction |
| Describes an external function imported from a module or object. More... | |
| class | ModuleParser |
| Parser for MXVM module definition files (.mxvm). More... | |
| struct | ParsedOp |
| A parsed operand with its kind, text, and source location. More... | |
| struct | UseVar |
| Records a variable usage site for validation. More... | |
| struct | UseLabel |
| Records a label usage site for validation. More... | |
| struct | OpSpec |
| Specification of valid operand patterns for an instruction. More... | |
| class | Validator |
| Validates MXVM source for correct variable/label usage and instruction operands. More... | |
Typedefs | |
| using | StackValue = std::variant<int64_t, void *, double, std::string> |
| Stack element: integer, pointer, double, or string. | |
| using | runtime_call = std::function<void(Program *program, std::vector<Operand> &operands)> |
| Callback type for runtime-registered native functions. | |
Enumerations | |
| enum class | OperandType { OP_CONSTANT , OP_VARIABLE } |
| Discriminates whether an operand is a compile-time constant or a variable reference. More... | |
| enum class | VarType { VAR_NULL = 0 , VAR_INTEGER , VAR_FLOAT , VAR_STRING , VAR_POINTER , VAR_LABEL , VAR_ARRAY , VAR_EXTERN , VAR_BYTE } |
| MXVM variable type discriminator. More... | |
| enum class | Keywords { KEY_PROGRAM , KEY_OBJECT , KEY_MODULE , KEY_DATA , KEY_CODE , KEY_SECTION } |
| MXVM language keywords. More... | |
| enum class | Mode { MODE_INTERPRET , MODE_COMPILE } |
| Execution mode: interpretation or native compilation. More... | |
| enum class | Platform { LINUX , DARWIN , WINX64 } |
| Target platform for native code generation. More... | |
| enum class | OpKind { Num , Hex , Str , Id , Member , Label , Any } |
| Classification of operand kinds for validation. More... | |
| enum class | VArity { None , AnyTail , ArgsTail } |
| Variadic arity policy for instruction operand specs. More... | |
Functions | |
| void | except_assert (std::string reason, bool value) |
| Assert a condition, throwing an Exception with the given reason on failure. | |
| bool | isFunctionReturningOwnedPtr (const std::string &funcName) |
| Check whether a named function returns an owned (heap-allocated) pointer. | |
| static std::unordered_set< std::string > | buildInstructionSet () |
| static std::unordered_set< std::string > | buildKeywordSet () |
| static void | releaseOwnedPointer (Variable &v) |
| std::string | toStringFromVarType (const VarType &v) |
| static bool | is_stdio_name (const std::string &s) |
| static int | stdio_index (const std::string &s) |
| static std::string | join_lines (const std::vector< std::string > &v) |
| static bool | is_label (const std::string &line) |
| static std::vector< std::string > | opt_core_lines (const std::vector< std::string > &lines) |
| static std::vector< std::string > | x64_opt_core_lines (const std::vector< std::string > &lines) |
| static std::string | darwin_prefix_calls (const std::string &line, const std::unordered_set< std::string > &macos_functions) |
| static std::vector< std::string > | opt_darwin_lines (const std::vector< std::string > &lines) |
| static std::vector< std::string > | opt_x64_windows_lines (const std::vector< std::string > &lines) |
| static std::vector< std::string > | opt_linux_lines (const std::vector< std::string > &lines) |
| static bool | isImmediate (const OpKind k) |
| static bool | has_semicolon (const std::string &s) |
| static bool | isIdLike (OpKind k) |
Variables | |
| std::vector< std::string > | keywords {"program", "object", "module", "data", "code", "section"} |
| String representations of Keywords enum values. | |
| bool | debug_mode = false |
| enable verbose debug output during parsing | |
| bool | instruct_mode = false |
| enable instruction trace mode | |
| bool | html_mode = false |
| enable HTML debug output | |
| static const std::unordered_set< std::string > | kInstructions = buildInstructionSet() |
| static const std::unordered_set< std::string > | kKeywords = buildKeywordSet() |
| static const std::unordered_set< std::string > | kTypes |
| static int | error_label_count = 0 |
| static unsigned | x64_sp_mod16 = 0 |
| size_t | xmm_offset |
| static int | error_label_count = 0 |
| static const std::unordered_map< std::string, OpSpec > | kOpSpecs |
| using mxvm::runtime_call = std::function<void(Program *program, std::vector<Operand> &operands)> |
| using mxvm::StackValue = std::variant<int64_t, void *, double, std::string> |
|
strong |
MXVM language keywords.
| Enumerator | |
|---|---|
| KEY_PROGRAM | |
| KEY_OBJECT | |
| KEY_MODULE | |
| KEY_DATA | |
| KEY_CODE | |
| KEY_SECTION | |
Definition at line 192 of file instruct.hpp.
|
strong |
Execution mode: interpretation or native compilation.
| Enumerator | |
|---|---|
| MODE_INTERPRET | |
| MODE_COMPILE | |
Definition at line 36 of file parser.hpp.
|
strong |
Discriminates whether an operand is a compile-time constant or a variable reference.
| Enumerator | |
|---|---|
| OP_CONSTANT | |
| OP_VARIABLE | |
Definition at line 153 of file instruct.hpp.
|
strong |
|
strong |
Target platform for native code generation.
| Enumerator | |
|---|---|
| LINUX | |
| DARWIN | |
| WINX64 | |
Definition at line 42 of file parser.hpp.
|
strong |
|
strong |
MXVM variable type discriminator.
| Enumerator | |
|---|---|
| VAR_NULL | |
| VAR_INTEGER | |
| VAR_FLOAT | |
| VAR_STRING | |
| VAR_POINTER | |
| VAR_LABEL | |
| VAR_ARRAY | |
| VAR_EXTERN | |
| VAR_BYTE | |
Definition at line 180 of file instruct.hpp.
|
static |
Definition at line 56 of file html_gen.cpp.
References IncType.
|
static |
Definition at line 66 of file html_gen.cpp.
References keywords.
|
static |
| void mxvm::except_assert | ( | std::string | reason, |
| bool | value ) |
Assert a condition, throwing an Exception with the given reason on failure.
| reason | Error message |
| value | Condition to assert (true = pass) |
Definition at line 436 of file icode.cpp.
Referenced by asReadPtr(), asWritePtr(), getStringFromVar(), mxvm_std_memcmp(), mxvm_std_memcpy(), mxvm_std_memmove(), mxvm_std_memset(), mxvm_string_snprintf(), mxvm_string_strcmp(), mxvm_string_strlen(), and mxvm_string_substr().
|
static |
Definition at line 20 of file valid.cpp.
Referenced by mxvm::Validator::validate().
|
static |
Definition at line 33 of file icode_opt.cpp.
Referenced by opt_core_lines(), and mxvm::HTMLGen::output().
|
inlinestatic |
Definition at line 32 of file icode_gen_x64.cpp.
Referenced by mxvm::Program::x64_analyzeRegAlloc(), mxvm::Program::x64_generateLoadVar(), and mxvm::Program::x64_generateLoadVar().
| bool mxvm::isFunctionReturningOwnedPtr | ( | const std::string & | funcName | ) |
Check whether a named function returns an owned (heap-allocated) pointer.
| funcName | Function name to check |
Definition at line 249 of file icode_gen_x64.cpp.
Referenced by mxvm::Program::generateInvokeCall(), and mxvm::Program::x64_generateInvokeCall().
|
static |
Definition at line 140 of file valid.cpp.
Referenced by mxvm::Validator::validateAgainstSpec().
|
inlinestatic |
|
static |
Definition at line 16 of file icode_opt.cpp.
Referenced by mxvm::Program::gen_optimize().
|
static |
Definition at line 38 of file icode_opt.cpp.
References is_label().
Referenced by mxvm::Program::gen_optimize().
|
static |
Definition at line 358 of file icode_opt.cpp.
References darwin_prefix_calls().
Referenced by mxvm::Program::gen_optimize().
|
static |
Definition at line 492 of file icode_opt.cpp.
Referenced by mxvm::Program::gen_optimize().
|
static |
Definition at line 452 of file icode_opt.cpp.
Referenced by mxvm::Program::gen_optimize().
|
inlinestatic |
Definition at line 13 of file icode_exec.cpp.
References mxvm::Variable_Value::owns, mxvm::Variable_Value::ptr_count, mxvm::Variable_Value::ptr_size, mxvm::Variable_Value::ptr_value, mxvm::Variable::type, VAR_POINTER, and mxvm::Variable::var_value.
Referenced by mxvm::Program::exec_alloc(), mxvm::Program::exec_mov(), and mxvm::Program::exec_return().
|
inlinestatic |
Definition at line 35 of file icode_gen_x64.cpp.
Referenced by mxvm::Program::x64_generateLoadVar(), and mxvm::Program::x64_generateLoadVar().
| std::string mxvm::toStringFromVarType | ( | const VarType & | v | ) |
Definition at line 1852 of file icode_exec.cpp.
References VAR_BYTE, VAR_EXTERN, VAR_FLOAT, VAR_INTEGER, VAR_POINTER, and VAR_STRING.
|
static |
Definition at line 159 of file icode_opt.cpp.
Referenced by mxvm::Program::gen_optimize().
| bool mxvm::debug_mode = false |
enable verbose debug output during parsing
Definition at line 96 of file parser.cpp.
Referenced by mxvm::Program::~Program(), action_interpret(), proc_args(), signal_action(), and translate_x64().
|
static |
Definition at line 12 of file icode_gen.cpp.
Referenced by mxvm::Program::gen_alloc(), mxvm::Program::gen_realloc(), mxvm::Program::x64_gen_alloc(), mxvm::Program::x64_gen_load(), mxvm::Program::x64_gen_realloc(), and mxvm::Program::x64_gen_store().
|
static |
Definition at line 18 of file icode_gen_x64.cpp.
| bool mxvm::html_mode = false |
enable HTML debug output
Definition at line 98 of file parser.cpp.
Referenced by action_interpret(), mxvm::Parser::generateProgramCode(), proc_args(), and translate_x64().
| bool mxvm::instruct_mode = false |
enable instruction trace mode
Definition at line 97 of file parser.cpp.
Referenced by mxvm::Program::exec(), and proc_args().
| std::vector< std::string > mxvm::keywords {"program", "object", "module", "data", "code", "section"} |
String representations of Keywords enum values.
Definition at line 10 of file instruct.cpp.
Referenced by buildKeywordSet(), and operator<<().
|
static |
Definition at line 78 of file html_gen.cpp.
Referenced by mxvm::HTMLGen::output().
|
static |
Definition at line 79 of file html_gen.cpp.
Referenced by mxvm::HTMLGen::output().
|
static |
Definition at line 92 of file valid.cpp.
Referenced by mxvm::Validator::validateAgainstSpec().
|
static |
Definition at line 80 of file html_gen.cpp.
Referenced by mxvm::HTMLGen::output().
|
static |
Definition at line 16 of file icode_gen_x64.cpp.
Referenced by mxvm::Program::x64_emitRestoreRegs(), mxvm::Program::x64_emitSaveRegs(), mxvm::Program::x64_gen_pop(), mxvm::Program::x64_gen_push(), mxvm::Program::x64_gen_stack_sub(), mxvm::Program::x64_generateCode(), mxvm::Program::x64_release_call_area(), and mxvm::Program::x64_reserve_call_area().
|
extern |