-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCPar.fsi
163 lines (160 loc) · 3.08 KB
/
CPar.fsi
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
// Signature file for parser generated by fsyacc
module CPar
type token =
| EOF
| LPAR
| RPAR
| LBRACE
| RBRACE
| LBRACK
| RBRACK
| SEMI
| COMMA
| ASSIGN
| AMP
| COLON
| QUE
| NOT
| SEQOR
| SEQAND
| EQ
| NE
| GT
| LT
| GE
| LE
| BOOL
| PLUS
| MINUS
| TIMES
| DIV
| MOD
| INC
| SUB
| PLUSASSIGN
| MINUSASSIGN
| TIMESASSIGN
| DIVASSIGN
| MODASSIGN
| CHAR
| ELSE
| IF
| INT
| NULL
| PRINT
| PRINTLN
| RETURN
| VOID
| WHILE
| FOR
| DOWHILE
| DO
| UNTIL
| DOUNTIL
| HEXCHANGE
| SWITCH
| CASE
| DEFAULT
| BREAK
| CONTINUE
| CSTSTRING of (string)
| NAME of (string)
| CSTINT of (int)
| CSTBOOL of (int)
type tokenId =
| TOKEN_EOF
| TOKEN_LPAR
| TOKEN_RPAR
| TOKEN_LBRACE
| TOKEN_RBRACE
| TOKEN_LBRACK
| TOKEN_RBRACK
| TOKEN_SEMI
| TOKEN_COMMA
| TOKEN_ASSIGN
| TOKEN_AMP
| TOKEN_COLON
| TOKEN_QUE
| TOKEN_NOT
| TOKEN_SEQOR
| TOKEN_SEQAND
| TOKEN_EQ
| TOKEN_NE
| TOKEN_GT
| TOKEN_LT
| TOKEN_GE
| TOKEN_LE
| TOKEN_BOOL
| TOKEN_PLUS
| TOKEN_MINUS
| TOKEN_TIMES
| TOKEN_DIV
| TOKEN_MOD
| TOKEN_INC
| TOKEN_SUB
| TOKEN_PLUSASSIGN
| TOKEN_MINUSASSIGN
| TOKEN_TIMESASSIGN
| TOKEN_DIVASSIGN
| TOKEN_MODASSIGN
| TOKEN_CHAR
| TOKEN_ELSE
| TOKEN_IF
| TOKEN_INT
| TOKEN_NULL
| TOKEN_PRINT
| TOKEN_PRINTLN
| TOKEN_RETURN
| TOKEN_VOID
| TOKEN_WHILE
| TOKEN_FOR
| TOKEN_DOWHILE
| TOKEN_DO
| TOKEN_UNTIL
| TOKEN_DOUNTIL
| TOKEN_HEXCHANGE
| TOKEN_SWITCH
| TOKEN_CASE
| TOKEN_DEFAULT
| TOKEN_BREAK
| TOKEN_CONTINUE
| TOKEN_CSTSTRING
| TOKEN_NAME
| TOKEN_CSTINT
| TOKEN_CSTBOOL
| TOKEN_end_of_input
| TOKEN_error
type nonTerminalId =
| NONTERM__startMain
| NONTERM_Main
| NONTERM_Topdecs
| NONTERM_Topdec
| NONTERM_Vardec
| NONTERM_Vardesc
| NONTERM_Fundec
| NONTERM_Paramdecs
| NONTERM_Paramdecs1
| NONTERM_Block
| NONTERM_StmtOrDecSeq
| NONTERM_Stmt
| NONTERM_StmtM
| NONTERM_StmtU
| NONTERM_Expr
| NONTERM_ExprNotAccess
| NONTERM_AtExprNotAccess
| NONTERM_Access
| NONTERM_Exprs
| NONTERM_Exprs1
| NONTERM_CaseList
| NONTERM_CaseDec
| NONTERM_Const
| NONTERM_Type
/// This function maps tokens to integer indexes
val tagOfToken: token -> int
/// This function maps integer indexes to symbolic token ids
val tokenTagToTokenId: int -> tokenId
/// This function maps production indexes returned in syntax errors to strings representing the non terminal that would be produced by that production
val prodIdxToNonTerminal: int -> nonTerminalId
/// This function gets the name of a token as a string
val token_to_string: token -> string
val Main : (FSharp.Text.Lexing.LexBuffer<'cty> -> token) -> FSharp.Text.Lexing.LexBuffer<'cty> -> (Absyn.program)