-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparser.plm
67 lines (57 loc) · 1.13 KB
/
parser.plm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
$list
/****h* plm/parser
*
* NAME
* parser
*
******
*/
parser:
do;
$include (..\plmlib\plmlib.inc)
$include (tokpars.inc)
declare stack (80) word;
declare stack$ptr uint;
stack$push: procedure (x);
declare x uint16;
stack(stack$ptr) = x;
stack$ptr = stack$ptr + 1;
end stack$push;
stack$pop: procedure uint16;
stack$ptr = stack$ptr - 1;
return stack(stack$ptr);
end stack$pop;
/*** Parser rules ***/
/* TODO */
/*
parse$loop: procedure;
end parse$loop;
*/
/****f* parser/parse
*
* NAME
* parse -- parse the input, generate the output
*
* SYNOPSIS
* call parse;
*
* DESCRIPTION
* Parse PL/M code using the tokenizer (from the source known by the
* tokenizer) and generate output code using the code generator.
*
******
*/
/*
parse: procedure;
end parse;
*/
parse$rule: procedure (start$rule, p$str) byte;
declare start$rule uint;
declare p$str pointer;
declare str based p$str (*) byte;
/* TODO */
/* call stack$push(rule$start); */
return 0FFh; /* TODO: fix: temporary */
end parse$rule;
end parser;