Create a parser context
This commit is contained in:
@ -5,9 +5,10 @@ FROM SYSTEM IMPORT ADR;
|
|||||||
FROM M2RTS IMPORT HALT, ExitOnHalt;
|
FROM M2RTS IMPORT HALT, ExitOnHalt;
|
||||||
|
|
||||||
FROM Lexer IMPORT Lexer, lexer_destroy, lexer_initialize;
|
FROM Lexer IMPORT Lexer, lexer_destroy, lexer_initialize;
|
||||||
|
FROM Parser IMPORT Parser;
|
||||||
FROM Transpiler IMPORT transpile;
|
FROM Transpiler IMPORT transpile;
|
||||||
FROM CommandLineInterface IMPORT PCommandLine, parse_command_line;
|
FROM CommandLineInterface IMPORT PCommandLine, parse_command_line;
|
||||||
FROM Parser IMPORT PAstModule, parse_module;
|
FROM Parser IMPORT PAstModule, parse;
|
||||||
|
|
||||||
VAR
|
VAR
|
||||||
command_line: PCommandLine;
|
command_line: PCommandLine;
|
||||||
@ -31,7 +32,7 @@ BEGIN
|
|||||||
IF IsNoError(source_input) THEN
|
IF IsNoError(source_input) THEN
|
||||||
lexer_initialize(ADR(lexer), source_input);
|
lexer_initialize(ADR(lexer), source_input);
|
||||||
|
|
||||||
ast_module := parse_module(ADR(lexer));
|
ast_module := parse(ADR(lexer));
|
||||||
transpile(ast_module, StdOut, command_line^.input);
|
transpile(ast_module, StdOut, command_line^.input);
|
||||||
|
|
||||||
lexer_destroy(ADR(lexer));
|
lexer_destroy(ADR(lexer));
|
||||||
|
@ -195,15 +195,6 @@ TYPE
|
|||||||
END;
|
END;
|
||||||
PAstModule = POINTER TO AstModule;
|
PAstModule = POINTER TO AstModule;
|
||||||
|
|
||||||
PROCEDURE parse_type_expression(lexer: PLexer): PAstTypeExpression;
|
PROCEDURE parse(lexer: PLexer): PAstModule;
|
||||||
PROCEDURE parse_type_part(lexer: PLexer): PPAstTypedDeclaration;
|
|
||||||
PROCEDURE parse_variable_part(lexer: PLexer): PPAstVariableDeclaration;
|
|
||||||
PROCEDURE parse_constant_part(lexer: PLexer): PPAstConstantDeclaration;
|
|
||||||
PROCEDURE parse_import_part(lexer: PLexer): PPAstImportStatement;
|
|
||||||
PROCEDURE parse_designator(lexer: PLexer): PAstExpression;
|
|
||||||
PROCEDURE parse_expression(lexer: PLexer): PAstExpression;
|
|
||||||
PROCEDURE parse_statement_part(lexer: PLexer): AstCompoundStatement;
|
|
||||||
PROCEDURE parse_procedure_part(lexer: PLexer): PPAstProcedureDeclaration;
|
|
||||||
PROCEDURE parse_module(lexer: PLexer): PAstModule;
|
|
||||||
|
|
||||||
END Parser.
|
END Parser.
|
||||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user