mirror of
https://github.com/irmen/prog8.git
synced 2024-08-17 17:29:01 +00:00
antlr grammar and AST for il65
This commit is contained in:
parent
437c948c05
commit
7e511a1fe9
@ -1,3 +1,3 @@
|
|||||||
|
|
||||||
parser:
|
parser:
|
||||||
./antlr.sh -o ../src/net/razorvine/il65/parser -listener -visitor -package net.razorvine.il65.parser tinybasic.g4
|
./antlr.sh -o ../src/il65/parser -listener -visitor -package il65.parser tinybasic.g4
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
50 INPUT "GUESS A NUMBER?", G
|
|
||||||
60 C = C+1
|
|
||||||
70 IF G=N GOTO 110
|
|
||||||
80 IF G>N PRINT "LOWER"
|
|
||||||
90 IF G<N PRINT "HIGHER"
|
|
||||||
100 GOTO 50
|
|
||||||
110 PRINT "YOU GUESSED IT IN", C, " TRIES!"
|
|
@ -5,50 +5,69 @@ IL65 lexer and parser grammar
|
|||||||
grammar il65;
|
grammar il65;
|
||||||
|
|
||||||
|
|
||||||
|
COMMENT : ';' ~[\r\n]* -> channel(1) ;
|
||||||
|
WS : [ \t] -> skip ;
|
||||||
|
EOL : [\r\n]+ -> skip ;
|
||||||
NAME : [a-zA-Z_][a-zA-Z0-9_]* ;
|
NAME : [a-zA-Z_][a-zA-Z0-9_]* ;
|
||||||
DEC_INTEGER : ('0'..'9') | (('1'..'9')('0'..'9')+);
|
DEC_INTEGER : ('0'..'9') | (('1'..'9')('0'..'9')+);
|
||||||
HEX_INTEGER : '$' (('a'..'f') | ('A'..'F') | ('0'..'9'))+ ;
|
HEX_INTEGER : '$' (('a'..'f') | ('A'..'F') | ('0'..'9'))+ ;
|
||||||
BIN_INTEGER : '%' ('0' | '1')+ ;
|
BIN_INTEGER : '%' ('0' | '1')+ ;
|
||||||
|
|
||||||
|
FLOAT_NUMBER : FNUMBER (('E'|'e') ('+' | '-')? FNUMBER)? ; // sign comes later from unary expression
|
||||||
|
fragment FNUMBER : ('0' .. '9') + ('.' ('0' .. '9') +)? ;
|
||||||
|
|
||||||
module :
|
fragment STRING_ESCAPE_SEQ : '\\' . | '\\' EOL;
|
||||||
line*
|
STRING :
|
||||||
EOF
|
'"' ( STRING_ESCAPE_SEQ | ~[\\\r\n\f"] )* '"'
|
||||||
|
{
|
||||||
|
// get rid of the enclosing quotes
|
||||||
|
String s = getText();
|
||||||
|
setText(s.substring(1, s.length() - 1));
|
||||||
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
line :
|
|
||||||
|
module : statement* EOF ;
|
||||||
|
|
||||||
|
statement :
|
||||||
directive
|
directive
|
||||||
|
| constdecl
|
||||||
|
| memoryvardecl
|
||||||
| vardecl
|
| vardecl
|
||||||
|
| varinitializer
|
||||||
| assignment
|
| assignment
|
||||||
| augassignment
|
| augassignment
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
directive :
|
directive : '%' singlename (directivearg? | directivearg (',' directivearg)*) ;
|
||||||
'%' singlename (literalvalue)?
|
|
||||||
;
|
|
||||||
|
|
||||||
vardecl:
|
directivearg : singlename | integerliteral ;
|
||||||
datatype arrayspec? singlename ('=' expression)?
|
|
||||||
;
|
|
||||||
|
|
||||||
datatype:
|
vardecl: datatype arrayspec? singlename ;
|
||||||
'byte' | 'word' | 'float' | 'str' | 'str_p' | 'str_s' | 'str_ps'
|
|
||||||
;
|
|
||||||
|
|
||||||
arrayspec:
|
varinitializer : datatype arrayspec? singlename '=' expression ;
|
||||||
'[' expression (',' expression)? ']'
|
|
||||||
;
|
|
||||||
|
|
||||||
assignment :
|
constdecl: 'const' varinitializer ;
|
||||||
assign_target '=' expression
|
|
||||||
;
|
memoryvardecl: 'memory' varinitializer;
|
||||||
|
|
||||||
|
datatype: 'byte' | 'word' | 'float' | 'str' | 'str_p' | 'str_s' | 'str_ps' ;
|
||||||
|
|
||||||
|
arrayspec: '[' expression (',' expression)? ']' ;
|
||||||
|
|
||||||
|
assignment : assign_target '=' expression ;
|
||||||
|
|
||||||
augassignment :
|
augassignment :
|
||||||
assign_target ('+=' | '-=' | '/=' | '//=' | '*=' | '**=' |
|
assign_target ('+=' | '-=' | '/=' | '//=' | '*=' | '**=' |
|
||||||
'<<=' | '>>=' | '<<@=' | '>>@=' | '&=' | '|=' | '^=') expression
|
'<<=' | '>>=' | '<<@=' | '>>@=' | '&=' | '|=' | '^=') expression
|
||||||
;
|
;
|
||||||
|
|
||||||
|
assign_target:
|
||||||
|
register
|
||||||
|
| singlename
|
||||||
|
| dottedname
|
||||||
|
;
|
||||||
|
|
||||||
expression :
|
expression :
|
||||||
unary_expression
|
unary_expression
|
||||||
@ -65,49 +84,32 @@ expression :
|
|||||||
| singlename
|
| singlename
|
||||||
;
|
;
|
||||||
|
|
||||||
unary_expression:
|
unary_expression :
|
||||||
'~' expression
|
'~' expression
|
||||||
| ('+' | '-') expression
|
| ('+' | '-') expression
|
||||||
| 'not' expression
|
| 'not' expression
|
||||||
;
|
;
|
||||||
|
|
||||||
singlename:
|
singlename : NAME ;
|
||||||
NAME
|
|
||||||
;
|
|
||||||
|
|
||||||
dottedname:
|
dottedname : NAME ('.' NAME)+ ;
|
||||||
NAME ('.' NAME)+
|
|
||||||
;
|
|
||||||
|
|
||||||
register:
|
register : 'A' | 'X' | 'Y' | 'AX' | 'AY' | 'XY' | 'SC' | 'SI' | 'SZ' ;
|
||||||
'A' | 'X' | 'Y' | 'AX' | 'AY' | 'XY' | 'SC' | 'SI' | 'SZ'
|
|
||||||
;
|
|
||||||
|
|
||||||
literalvalue:
|
integerliteral : DEC_INTEGER | HEX_INTEGER | BIN_INTEGER ;
|
||||||
BIN_INTEGER | HEX_INTEGER | DEC_INTEGER
|
|
||||||
| 'true' | 'false'
|
|
||||||
| array
|
|
||||||
;
|
|
||||||
|
|
||||||
array:
|
booleanliteral : 'true' | 'false' ;
|
||||||
'[' expression (',' expression)* ']'
|
|
||||||
;
|
|
||||||
|
|
||||||
|
arrayliteral : '[' expression (',' expression)* ']' ;
|
||||||
|
|
||||||
assign_target:
|
stringliteral : STRING ;
|
||||||
register
|
|
||||||
| singlename
|
|
||||||
| dottedname
|
|
||||||
;
|
|
||||||
|
|
||||||
COMMENT :
|
floatliteral : FLOAT_NUMBER ;
|
||||||
';' ~[\r\n]* -> channel(1)
|
|
||||||
;
|
|
||||||
|
|
||||||
WS :
|
literalvalue :
|
||||||
[ \t] -> skip
|
integerliteral
|
||||||
;
|
| booleanliteral
|
||||||
|
| arrayliteral
|
||||||
EOL :
|
| stringliteral
|
||||||
[\r\n]+ -> skip
|
| floatliteral
|
||||||
;
|
;
|
||||||
|
@ -1,118 +0,0 @@
|
|||||||
/*
|
|
||||||
BSD License
|
|
||||||
Copyright (c) 2017, Tom Everett
|
|
||||||
All rights reserved.
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions
|
|
||||||
are met:
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer.
|
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer in the
|
|
||||||
documentation and/or other materials provided with the distribution.
|
|
||||||
3. Neither the name of Tom Everett nor the names of its contributors
|
|
||||||
may be used to endorse or promote products derived from this software
|
|
||||||
without specific prior written permission.
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
grammar tinybasic;
|
|
||||||
|
|
||||||
|
|
||||||
program
|
|
||||||
: line*
|
|
||||||
EOF
|
|
||||||
;
|
|
||||||
|
|
||||||
line
|
|
||||||
: number statement CR
|
|
||||||
| statement CR
|
|
||||||
;
|
|
||||||
|
|
||||||
statement
|
|
||||||
: 'PRINT' exprlist
|
|
||||||
| 'IF' expression relop expression 'THEN'? statement
|
|
||||||
| 'GOTO' number
|
|
||||||
| 'INPUT' varlist
|
|
||||||
| 'LET'? vara '=' expression
|
|
||||||
| 'GOSUB' expression
|
|
||||||
| 'RETURN'
|
|
||||||
| 'CLEAR'
|
|
||||||
| 'LIST'
|
|
||||||
| 'RUN'
|
|
||||||
| 'END'
|
|
||||||
;
|
|
||||||
|
|
||||||
exprlist
|
|
||||||
: (STRING | expression) (',' (STRING | expression))*
|
|
||||||
;
|
|
||||||
|
|
||||||
varlist
|
|
||||||
: vara (',' vara)*
|
|
||||||
;
|
|
||||||
|
|
||||||
expression
|
|
||||||
: ('+' | '-' | 'ε')? term (('+' | '-') term)*
|
|
||||||
;
|
|
||||||
|
|
||||||
term
|
|
||||||
: factor (('*' | '/') factor)*
|
|
||||||
;
|
|
||||||
|
|
||||||
factor
|
|
||||||
:
|
|
||||||
vara
|
|
||||||
| number
|
|
||||||
;
|
|
||||||
|
|
||||||
vara
|
|
||||||
: VAR
|
|
||||||
| STRING
|
|
||||||
;
|
|
||||||
|
|
||||||
number
|
|
||||||
: DIGIT +
|
|
||||||
;
|
|
||||||
|
|
||||||
relop
|
|
||||||
: ('<' ('>' | '=' | 'ε')?)
|
|
||||||
| ('>' ('<' | '=' | 'ε')?)
|
|
||||||
| '='
|
|
||||||
| '+'
|
|
||||||
| '-'
|
|
||||||
;
|
|
||||||
|
|
||||||
|
|
||||||
STRING
|
|
||||||
: '"' ~ ["\r\n]* '"'
|
|
||||||
;
|
|
||||||
|
|
||||||
|
|
||||||
DIGIT
|
|
||||||
: '0' .. '9'
|
|
||||||
;
|
|
||||||
|
|
||||||
|
|
||||||
VAR
|
|
||||||
: 'A' .. 'Z'
|
|
||||||
;
|
|
||||||
|
|
||||||
|
|
||||||
CR
|
|
||||||
: [\r\n]+
|
|
||||||
;
|
|
||||||
|
|
||||||
|
|
||||||
WS
|
|
||||||
: [ \t] -> skip
|
|
||||||
;
|
|
@ -1,70 +0,0 @@
|
|||||||
package il65.ast
|
|
||||||
|
|
||||||
import net.razorvine.il65.parser.tinybasicParser
|
|
||||||
|
|
||||||
interface Node
|
|
||||||
interface Statement : Node
|
|
||||||
|
|
||||||
data class Program(val lines: List<Line>) : Node
|
|
||||||
data class Line(val number: Int?, val statement: Statement) : Node
|
|
||||||
|
|
||||||
data class Print(val exprlist: List<Expression>) : Statement
|
|
||||||
data class If(val expression1: Expression, val relop: Char, val expression2: Expression, val then: Statement) : Statement
|
|
||||||
data class Goto(val number: Int) : Statement
|
|
||||||
data class Input(val varlist: List<Var>) : Statement
|
|
||||||
data class Let(val vara: Var, val expression: Expression) : Statement
|
|
||||||
data class Gosub(val expression: Expression): Statement
|
|
||||||
class Return: Statement
|
|
||||||
class Clear : Statement
|
|
||||||
class ListStmt : Statement
|
|
||||||
class Run : Statement
|
|
||||||
class End : Statement
|
|
||||||
|
|
||||||
data class TermListTerm(val operator: Char, val term: Term) : Node
|
|
||||||
data class FactorListFactor(val operator: Char, val factor: Factor) : Node
|
|
||||||
data class Expression(val unaryOp: Char?, val term: Term, val terms: List<TermListTerm>) : Node
|
|
||||||
data class Term(val factor: Factor, val factors: List<FactorListFactor>) : Node
|
|
||||||
data class Factor(val thing: String) : Node
|
|
||||||
data class Var(val thing: String): Node
|
|
||||||
|
|
||||||
|
|
||||||
fun tinybasicParser.ProgramContext.toAst(): Program = Program(this.line().map {
|
|
||||||
Line(it.number().toAst(), it.statement().toAst())
|
|
||||||
})
|
|
||||||
|
|
||||||
fun tinybasicParser.NumberContext.toAst(): Int = this.DIGIT().joinToString(separator = "").toInt()
|
|
||||||
|
|
||||||
fun tinybasicParser.StatementContext.toAst(): Statement =
|
|
||||||
when (this.children[0].text) {
|
|
||||||
"INPUT" -> Input(this.varlist().toAst())
|
|
||||||
"IF" -> If(this.expression(0).toAst(), this.relop().toAst(), this.expression(1).toAst(), this.statement().toAst())
|
|
||||||
"PRINT" -> Print(this.exprlist().toAst())
|
|
||||||
"GOTO" -> Goto(this.number().toAst())
|
|
||||||
"LET" -> Let(this.vara().toAst(), this.expression(0).toAst())
|
|
||||||
"GOSUB" -> Gosub(this.expression(0).toAst())
|
|
||||||
"RETURN" -> Return()
|
|
||||||
"CLEAR" -> Clear()
|
|
||||||
"LIST" -> ListStmt()
|
|
||||||
"RUN" -> Run()
|
|
||||||
"END" -> End()
|
|
||||||
else -> Let(this.vara().toAst(), this.expression(0).toAst())
|
|
||||||
}
|
|
||||||
|
|
||||||
fun tinybasicParser.RelopContext.toAst() : Char = this.text[0]
|
|
||||||
|
|
||||||
fun tinybasicParser.VarlistContext.toAst() : List<Var> {
|
|
||||||
return emptyList()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun tinybasicParser.ExprlistContext.toAst() : List<Expression> {
|
|
||||||
return emptyList()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun tinybasicParser.VaraContext.toAst() : Var = Var(this.text)
|
|
||||||
|
|
||||||
fun tinybasicParser.ExpressionContext.toAst() : Expression {
|
|
||||||
val unaryOp = '+'
|
|
||||||
val term = Term(Factor("derp"), emptyList())
|
|
||||||
return Expression(unaryOp, term, emptyList())
|
|
||||||
}
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
|||||||
package il65
|
|
||||||
|
|
||||||
import il65.ast.*
|
|
||||||
import net.razorvine.il65.parser.tinybasicLexer
|
|
||||||
import net.razorvine.il65.parser.tinybasicParser
|
|
||||||
import org.antlr.v4.runtime.CharStreams
|
|
||||||
import org.antlr.v4.runtime.CommonTokenStream
|
|
||||||
|
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
|
||||||
println("Reading source file: ${args[0]}")
|
|
||||||
val input = CharStreams.fromFileName(args[0])
|
|
||||||
val lexer = tinybasicLexer(input)
|
|
||||||
val tokens = CommonTokenStream(lexer)
|
|
||||||
val parser = tinybasicParser(tokens)
|
|
||||||
val parseTree: tinybasicParser.ProgramContext = parser.program()
|
|
||||||
val program = parseTree.toAst()
|
|
||||||
println(program)
|
|
||||||
}
|
|
||||||
|
|
27
il65/src/il65/Main.kt
Normal file
27
il65/src/il65/Main.kt
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
package il65
|
||||||
|
|
||||||
|
import il65.ast.toAst
|
||||||
|
import il65.parser.il65Lexer
|
||||||
|
import il65.parser.il65Parser
|
||||||
|
import org.antlr.v4.runtime.CharStreams
|
||||||
|
import org.antlr.v4.runtime.CommonTokenStream
|
||||||
|
|
||||||
|
|
||||||
|
fun main(args: Array<String>) {
|
||||||
|
// println("Reading source file: ${args[0]}")
|
||||||
|
|
||||||
|
val input = CharStreams.fromString(
|
||||||
|
"AX //= (5+8)*77\n" +
|
||||||
|
"X = -3.44e-99")
|
||||||
|
val lexer = il65Lexer(input)
|
||||||
|
val tokens = CommonTokenStream(lexer)
|
||||||
|
val parser = il65Parser(tokens)
|
||||||
|
|
||||||
|
val module = parser.module()
|
||||||
|
val program = module.toAst()
|
||||||
|
|
||||||
|
program.lines.map {
|
||||||
|
println(it)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
211
il65/src/il65/ast/AST.kt
Normal file
211
il65/src/il65/ast/AST.kt
Normal file
@ -0,0 +1,211 @@
|
|||||||
|
package il65.ast
|
||||||
|
|
||||||
|
import il65.parser.il65Parser
|
||||||
|
import org.antlr.v4.runtime.tree.TerminalNode
|
||||||
|
|
||||||
|
enum class DataType {
|
||||||
|
BYTE,
|
||||||
|
WORD,
|
||||||
|
FLOAT,
|
||||||
|
STR,
|
||||||
|
STR_P,
|
||||||
|
STR_S,
|
||||||
|
STR_PS
|
||||||
|
}
|
||||||
|
|
||||||
|
enum class Register {
|
||||||
|
A,
|
||||||
|
X,
|
||||||
|
Y,
|
||||||
|
AX,
|
||||||
|
AY,
|
||||||
|
XY,
|
||||||
|
SI,
|
||||||
|
SC,
|
||||||
|
SZ
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Node
|
||||||
|
|
||||||
|
interface IStatement : Node
|
||||||
|
|
||||||
|
data class Module(val lines: List<IStatement>) : Node
|
||||||
|
|
||||||
|
data class Directive(val directive: String, val args: List<DirectiveArg>) : IStatement
|
||||||
|
|
||||||
|
data class DirectiveArg(val strval: String?, val intval: Int?) : Node
|
||||||
|
|
||||||
|
interface IVarDecl : IStatement {
|
||||||
|
val datatype: DataType
|
||||||
|
val arrayspec: ArraySpec?
|
||||||
|
val name: String
|
||||||
|
val value: IExpression?
|
||||||
|
}
|
||||||
|
|
||||||
|
data class ArraySpec(val x: IExpression, val y: IExpression?) : Node
|
||||||
|
|
||||||
|
data class VarDecl(override val datatype: DataType,
|
||||||
|
override val arrayspec: ArraySpec?,
|
||||||
|
override val name: String,
|
||||||
|
override val value: IExpression?) : IVarDecl
|
||||||
|
|
||||||
|
data class ConstDecl(override val datatype: DataType,
|
||||||
|
override val arrayspec: ArraySpec?,
|
||||||
|
override val name: String,
|
||||||
|
override val value: IExpression) : IVarDecl
|
||||||
|
|
||||||
|
data class MemoryVarDecl(override val datatype: DataType,
|
||||||
|
override val arrayspec: ArraySpec?,
|
||||||
|
override val name: String,
|
||||||
|
override val value: IExpression) : IVarDecl
|
||||||
|
|
||||||
|
data class Assignment(val target: AssignTarget, val aug_op : String?, val value: IExpression) : IStatement
|
||||||
|
|
||||||
|
data class AssignTarget(val register: Register?, val singlename: String?, val dottedname: String?) : Node
|
||||||
|
|
||||||
|
|
||||||
|
interface IExpression: Node
|
||||||
|
|
||||||
|
data class UnaryExpression(val operator: String, val expression: IExpression) : IExpression
|
||||||
|
|
||||||
|
data class BinaryExpression(val left: IExpression, val operator: String, val right: IExpression) : IExpression
|
||||||
|
|
||||||
|
data class LiteralValue(val intvalue: Int?,
|
||||||
|
val floatvalue: Double?,
|
||||||
|
val strvalue: String?,
|
||||||
|
val boolvalue: Boolean?,
|
||||||
|
val arrayvalue: List<IExpression>?) : IExpression
|
||||||
|
|
||||||
|
data class RegisterExpr(val register: Register) : IExpression
|
||||||
|
|
||||||
|
data class DottedNameExpr(val dottedname: String) : IExpression
|
||||||
|
|
||||||
|
data class SingleNameExpr(val name: String) : IExpression
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
fun il65Parser.ModuleContext.toAst() = Module(this.statement().map { it.toAst() })
|
||||||
|
|
||||||
|
fun il65Parser.StatementContext.toAst() : IStatement {
|
||||||
|
val directive = this.directive()?.toAst()
|
||||||
|
if(directive!=null) return directive
|
||||||
|
|
||||||
|
val vardecl = this.vardecl()
|
||||||
|
if(vardecl!=null) {
|
||||||
|
return VarDecl(vardecl.datatype().toAst(),
|
||||||
|
vardecl.arrayspec()?.toAst(),
|
||||||
|
vardecl.singlename().text,
|
||||||
|
null)
|
||||||
|
}
|
||||||
|
|
||||||
|
val constdecl = this.constdecl()
|
||||||
|
if(constdecl!=null) {
|
||||||
|
val varinit = constdecl.varinitializer()
|
||||||
|
return ConstDecl(varinit.datatype().toAst(),
|
||||||
|
varinit.arrayspec()?.toAst(),
|
||||||
|
varinit.singlename().text,
|
||||||
|
varinit.expression().toAst())
|
||||||
|
}
|
||||||
|
|
||||||
|
val memdecl = this.memoryvardecl()
|
||||||
|
if(memdecl!=null) {
|
||||||
|
val varinit = memdecl.varinitializer()
|
||||||
|
return MemoryVarDecl(varinit.datatype().toAst(),
|
||||||
|
varinit.arrayspec()?.toAst(),
|
||||||
|
varinit.singlename().text,
|
||||||
|
varinit.expression().toAst())
|
||||||
|
}
|
||||||
|
|
||||||
|
val assign = this.assignment()
|
||||||
|
if (assign!=null) {
|
||||||
|
return Assignment(assign.assign_target().toAst(), null, assign.expression().toAst())
|
||||||
|
}
|
||||||
|
|
||||||
|
val augassign = this.augassignment()
|
||||||
|
if (augassign!=null) {
|
||||||
|
return Assignment(
|
||||||
|
augassign.assign_target().toAst(),
|
||||||
|
augassign.children[1].text,
|
||||||
|
augassign.expression().toAst())
|
||||||
|
}
|
||||||
|
|
||||||
|
throw UnsupportedOperationException(this.text)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun il65Parser.Assign_targetContext.toAst() =
|
||||||
|
AssignTarget(this.register()?.toAst(), this.singlename()?.text, this.dottedname()?.text)
|
||||||
|
|
||||||
|
fun il65Parser.RegisterContext.toAst() = Register.valueOf(this.text)
|
||||||
|
|
||||||
|
fun il65Parser.DatatypeContext.toAst() = DataType.valueOf(this.text)
|
||||||
|
|
||||||
|
fun il65Parser.ArrayspecContext.toAst() = ArraySpec(
|
||||||
|
this.expression(0).toAst(),
|
||||||
|
if (this.expression().size > 1) this.expression(1).toAst() else null
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
fun il65Parser.DirectiveContext.toAst() = Directive(this.singlename().text, this.directivearg().map { it.toAst() })
|
||||||
|
|
||||||
|
fun il65Parser.DirectiveargContext.toAst() = DirectiveArg(this.singlename()?.text, this.integerliteral()?.toAst())
|
||||||
|
|
||||||
|
fun il65Parser.IntegerliteralContext.toAst(): Int {
|
||||||
|
val terminal: TerminalNode = this.children[0] as TerminalNode
|
||||||
|
return when (terminal.symbol.type) {
|
||||||
|
il65Parser.DEC_INTEGER -> this.text.toInt()
|
||||||
|
il65Parser.HEX_INTEGER -> this.text.toInt(16)
|
||||||
|
il65Parser.BIN_INTEGER -> this.text.toInt(2)
|
||||||
|
else -> throw UnsupportedOperationException(this.text)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun il65Parser.ExpressionContext.toAst() : IExpression {
|
||||||
|
|
||||||
|
if(this.singlename()!=null) {
|
||||||
|
return SingleNameExpr(this.singlename().text)
|
||||||
|
}
|
||||||
|
|
||||||
|
val litval = this.literalvalue()
|
||||||
|
if(litval!=null) {
|
||||||
|
return LiteralValue(litval.integerliteral()?.toAst(),
|
||||||
|
litval.floatliteral()?.toAst(),
|
||||||
|
litval.stringliteral()?.text,
|
||||||
|
litval.booleanliteral()?.toAst(),
|
||||||
|
litval.arrayliteral()?.toAst()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.dottedname()!=null) {
|
||||||
|
return DottedNameExpr(this.dottedname().text)
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.register()!=null) {
|
||||||
|
return RegisterExpr(this.register().toAst())
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.unary_expression()!=null) {
|
||||||
|
return UnaryExpression(this.unary_expression().children[0].text, this.unary_expression().expression().toAst())
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.expression().size == 2) {
|
||||||
|
return BinaryExpression(this.expression(0).toAst(), this.text, this.expression(1).toAst())
|
||||||
|
}
|
||||||
|
|
||||||
|
// (....)
|
||||||
|
if(this.childCount == 3 && this.children[0].text=="(" && this.children[2].text==")") {
|
||||||
|
return this.expression(0).toAst()
|
||||||
|
}
|
||||||
|
|
||||||
|
throw UnsupportedOperationException(this.text)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun il65Parser.FloatliteralContext.toAst() = this.text.toDouble()
|
||||||
|
|
||||||
|
fun il65Parser.BooleanliteralContext.toAst() = when(this.text) {
|
||||||
|
"true" -> true
|
||||||
|
"false" -> false
|
||||||
|
else -> throw UnsupportedOperationException(this.text)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun il65Parser.ArrayliteralContext.toAst() = this.expression().map { it.toAst() }
|
||||||
|
|
139
il65/src/il65/parser/il65.tokens
Normal file
139
il65/src/il65/parser/il65.tokens
Normal file
@ -0,0 +1,139 @@
|
|||||||
|
T__0=1
|
||||||
|
T__1=2
|
||||||
|
T__2=3
|
||||||
|
T__3=4
|
||||||
|
T__4=5
|
||||||
|
T__5=6
|
||||||
|
T__6=7
|
||||||
|
T__7=8
|
||||||
|
T__8=9
|
||||||
|
T__9=10
|
||||||
|
T__10=11
|
||||||
|
T__11=12
|
||||||
|
T__12=13
|
||||||
|
T__13=14
|
||||||
|
T__14=15
|
||||||
|
T__15=16
|
||||||
|
T__16=17
|
||||||
|
T__17=18
|
||||||
|
T__18=19
|
||||||
|
T__19=20
|
||||||
|
T__20=21
|
||||||
|
T__21=22
|
||||||
|
T__22=23
|
||||||
|
T__23=24
|
||||||
|
T__24=25
|
||||||
|
T__25=26
|
||||||
|
T__26=27
|
||||||
|
T__27=28
|
||||||
|
T__28=29
|
||||||
|
T__29=30
|
||||||
|
T__30=31
|
||||||
|
T__31=32
|
||||||
|
T__32=33
|
||||||
|
T__33=34
|
||||||
|
T__34=35
|
||||||
|
T__35=36
|
||||||
|
T__36=37
|
||||||
|
T__37=38
|
||||||
|
T__38=39
|
||||||
|
T__39=40
|
||||||
|
T__40=41
|
||||||
|
T__41=42
|
||||||
|
T__42=43
|
||||||
|
T__43=44
|
||||||
|
T__44=45
|
||||||
|
T__45=46
|
||||||
|
T__46=47
|
||||||
|
T__47=48
|
||||||
|
T__48=49
|
||||||
|
T__49=50
|
||||||
|
T__50=51
|
||||||
|
T__51=52
|
||||||
|
T__52=53
|
||||||
|
T__53=54
|
||||||
|
T__54=55
|
||||||
|
T__55=56
|
||||||
|
T__56=57
|
||||||
|
T__57=58
|
||||||
|
T__58=59
|
||||||
|
T__59=60
|
||||||
|
T__60=61
|
||||||
|
T__61=62
|
||||||
|
T__62=63
|
||||||
|
T__63=64
|
||||||
|
T__64=65
|
||||||
|
COMMENT=66
|
||||||
|
WS=67
|
||||||
|
EOL=68
|
||||||
|
NAME=69
|
||||||
|
DEC_INTEGER=70
|
||||||
|
HEX_INTEGER=71
|
||||||
|
BIN_INTEGER=72
|
||||||
|
FLOAT_NUMBER=73
|
||||||
|
STRING=74
|
||||||
|
'%'=1
|
||||||
|
','=2
|
||||||
|
'='=3
|
||||||
|
'const'=4
|
||||||
|
'memory'=5
|
||||||
|
'byte'=6
|
||||||
|
'word'=7
|
||||||
|
'float'=8
|
||||||
|
'str'=9
|
||||||
|
'str_p'=10
|
||||||
|
'str_s'=11
|
||||||
|
'str_ps'=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
|
||||||
|
'and'=43
|
||||||
|
'or'=44
|
||||||
|
'xor'=45
|
||||||
|
'=='=46
|
||||||
|
'!='=47
|
||||||
|
'<'=48
|
||||||
|
'>'=49
|
||||||
|
'<='=50
|
||||||
|
'>='=51
|
||||||
|
'~'=52
|
||||||
|
'not'=53
|
||||||
|
'.'=54
|
||||||
|
'A'=55
|
||||||
|
'X'=56
|
||||||
|
'Y'=57
|
||||||
|
'AX'=58
|
||||||
|
'AY'=59
|
||||||
|
'XY'=60
|
||||||
|
'SC'=61
|
||||||
|
'SI'=62
|
||||||
|
'SZ'=63
|
||||||
|
'true'=64
|
||||||
|
'false'=65
|
308
il65/src/il65/parser/il65Lexer.java
Normal file
308
il65/src/il65/parser/il65Lexer.java
Normal file
@ -0,0 +1,308 @@
|
|||||||
|
// Generated from /home/irmen/Projects/IL65/il65/antlr/il65.g4 by ANTLR 4.7
|
||||||
|
package il65.parser;
|
||||||
|
import org.antlr.v4.runtime.Lexer;
|
||||||
|
import org.antlr.v4.runtime.CharStream;
|
||||||
|
import org.antlr.v4.runtime.Token;
|
||||||
|
import org.antlr.v4.runtime.TokenStream;
|
||||||
|
import org.antlr.v4.runtime.*;
|
||||||
|
import org.antlr.v4.runtime.atn.*;
|
||||||
|
import org.antlr.v4.runtime.dfa.DFA;
|
||||||
|
import org.antlr.v4.runtime.misc.*;
|
||||||
|
|
||||||
|
@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
|
||||||
|
public class il65Lexer extends Lexer {
|
||||||
|
static { RuntimeMetaData.checkVersion("4.7", RuntimeMetaData.VERSION); }
|
||||||
|
|
||||||
|
protected static final DFA[] _decisionToDFA;
|
||||||
|
protected static final PredictionContextCache _sharedContextCache =
|
||||||
|
new PredictionContextCache();
|
||||||
|
public static final int
|
||||||
|
T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, T__6=7, T__7=8, T__8=9,
|
||||||
|
T__9=10, T__10=11, T__11=12, T__12=13, T__13=14, T__14=15, T__15=16, T__16=17,
|
||||||
|
T__17=18, T__18=19, T__19=20, T__20=21, T__21=22, T__22=23, T__23=24,
|
||||||
|
T__24=25, T__25=26, T__26=27, T__27=28, T__28=29, T__29=30, T__30=31,
|
||||||
|
T__31=32, T__32=33, T__33=34, T__34=35, T__35=36, T__36=37, T__37=38,
|
||||||
|
T__38=39, T__39=40, T__40=41, T__41=42, T__42=43, T__43=44, T__44=45,
|
||||||
|
T__45=46, T__46=47, T__47=48, T__48=49, T__49=50, T__50=51, T__51=52,
|
||||||
|
T__52=53, T__53=54, T__54=55, T__55=56, T__56=57, T__57=58, T__58=59,
|
||||||
|
T__59=60, T__60=61, T__61=62, T__62=63, T__63=64, T__64=65, COMMENT=66,
|
||||||
|
WS=67, EOL=68, NAME=69, DEC_INTEGER=70, HEX_INTEGER=71, BIN_INTEGER=72,
|
||||||
|
FLOAT_NUMBER=73, STRING=74;
|
||||||
|
public static String[] channelNames = {
|
||||||
|
"DEFAULT_TOKEN_CHANNEL", "HIDDEN"
|
||||||
|
};
|
||||||
|
|
||||||
|
public static String[] modeNames = {
|
||||||
|
"DEFAULT_MODE"
|
||||||
|
};
|
||||||
|
|
||||||
|
public static final String[] ruleNames = {
|
||||||
|
"T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8",
|
||||||
|
"T__9", "T__10", "T__11", "T__12", "T__13", "T__14", "T__15", "T__16",
|
||||||
|
"T__17", "T__18", "T__19", "T__20", "T__21", "T__22", "T__23", "T__24",
|
||||||
|
"T__25", "T__26", "T__27", "T__28", "T__29", "T__30", "T__31", "T__32",
|
||||||
|
"T__33", "T__34", "T__35", "T__36", "T__37", "T__38", "T__39", "T__40",
|
||||||
|
"T__41", "T__42", "T__43", "T__44", "T__45", "T__46", "T__47", "T__48",
|
||||||
|
"T__49", "T__50", "T__51", "T__52", "T__53", "T__54", "T__55", "T__56",
|
||||||
|
"T__57", "T__58", "T__59", "T__60", "T__61", "T__62", "T__63", "T__64",
|
||||||
|
"COMMENT", "WS", "EOL", "NAME", "DEC_INTEGER", "HEX_INTEGER", "BIN_INTEGER",
|
||||||
|
"FLOAT_NUMBER", "FNUMBER", "STRING_ESCAPE_SEQ", "STRING"
|
||||||
|
};
|
||||||
|
|
||||||
|
private static final String[] _LITERAL_NAMES = {
|
||||||
|
null, "'%'", "','", "'='", "'const'", "'memory'", "'byte'", "'word'",
|
||||||
|
"'float'", "'str'", "'str_p'", "'str_s'", "'str_ps'", "'['", "']'", "'+='",
|
||||||
|
"'-='", "'/='", "'//='", "'*='", "'**='", "'<<='", "'>>='", "'<<@='",
|
||||||
|
"'>>@='", "'&='", "'|='", "'^='", "'('", "')'", "'**'", "'*'", "'/'",
|
||||||
|
"'//'", "'+'", "'-'", "'<<'", "'>>'", "'<<@'", "'>>@'", "'&'", "'|'",
|
||||||
|
"'^'", "'and'", "'or'", "'xor'", "'=='", "'!='", "'<'", "'>'", "'<='",
|
||||||
|
"'>='", "'~'", "'not'", "'.'", "'A'", "'X'", "'Y'", "'AX'", "'AY'", "'XY'",
|
||||||
|
"'SC'", "'SI'", "'SZ'", "'true'", "'false'"
|
||||||
|
};
|
||||||
|
private static final String[] _SYMBOLIC_NAMES = {
|
||||||
|
null, null, null, null, null, null, null, null, null, null, null, null,
|
||||||
|
null, null, null, null, null, null, null, null, null, null, null, null,
|
||||||
|
null, null, null, null, null, null, null, null, null, null, null, null,
|
||||||
|
null, null, null, null, null, null, null, null, null, null, null, null,
|
||||||
|
null, null, null, null, null, null, null, null, null, null, null, null,
|
||||||
|
null, null, null, null, null, null, "COMMENT", "WS", "EOL", "NAME", "DEC_INTEGER",
|
||||||
|
"HEX_INTEGER", "BIN_INTEGER", "FLOAT_NUMBER", "STRING"
|
||||||
|
};
|
||||||
|
public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated Use {@link #VOCABULARY} instead.
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
public static final String[] tokenNames;
|
||||||
|
static {
|
||||||
|
tokenNames = new String[_SYMBOLIC_NAMES.length];
|
||||||
|
for (int i = 0; i < tokenNames.length; i++) {
|
||||||
|
tokenNames[i] = VOCABULARY.getLiteralName(i);
|
||||||
|
if (tokenNames[i] == null) {
|
||||||
|
tokenNames[i] = VOCABULARY.getSymbolicName(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tokenNames[i] == null) {
|
||||||
|
tokenNames[i] = "<INVALID>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Deprecated
|
||||||
|
public String[] getTokenNames() {
|
||||||
|
return tokenNames;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
|
||||||
|
public Vocabulary getVocabulary() {
|
||||||
|
return VOCABULARY;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public il65Lexer(CharStream input) {
|
||||||
|
super(input);
|
||||||
|
_interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getGrammarFileName() { return "il65.g4"; }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getRuleNames() { return ruleNames; }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getSerializedATN() { return _serializedATN; }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getChannelNames() { return channelNames; }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getModeNames() { return modeNames; }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ATN getATN() { return _ATN; }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void action(RuleContext _localctx, int ruleIndex, int actionIndex) {
|
||||||
|
switch (ruleIndex) {
|
||||||
|
case 75:
|
||||||
|
STRING_action((RuleContext)_localctx, actionIndex);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void STRING_action(RuleContext _localctx, int actionIndex) {
|
||||||
|
switch (actionIndex) {
|
||||||
|
case 0:
|
||||||
|
|
||||||
|
// get rid of the enclosing quotes
|
||||||
|
String s = getText();
|
||||||
|
setText(s.substring(1, s.length() - 1));
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String _serializedATN =
|
||||||
|
"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2L\u01ca\b\1\4\2\t"+
|
||||||
|
"\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13"+
|
||||||
|
"\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+
|
||||||
|
"\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+
|
||||||
|
"\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37\t\37\4 \t \4!"+
|
||||||
|
"\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\4"+
|
||||||
|
",\t,\4-\t-\4.\t.\4/\t/\4\60\t\60\4\61\t\61\4\62\t\62\4\63\t\63\4\64\t"+
|
||||||
|
"\64\4\65\t\65\4\66\t\66\4\67\t\67\48\t8\49\t9\4:\t:\4;\t;\4<\t<\4=\t="+
|
||||||
|
"\4>\t>\4?\t?\4@\t@\4A\tA\4B\tB\4C\tC\4D\tD\4E\tE\4F\tF\4G\tG\4H\tH\4I"+
|
||||||
|
"\tI\4J\tJ\4K\tK\4L\tL\4M\tM\3\2\3\2\3\3\3\3\3\4\3\4\3\5\3\5\3\5\3\5\3"+
|
||||||
|
"\5\3\5\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\b\3\b\3\b\3\b"+
|
||||||
|
"\3\b\3\t\3\t\3\t\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3\13\3\13\3\13\3\13\3\13"+
|
||||||
|
"\3\13\3\f\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\16\3\16\3"+
|
||||||
|
"\17\3\17\3\20\3\20\3\20\3\21\3\21\3\21\3\22\3\22\3\22\3\23\3\23\3\23\3"+
|
||||||
|
"\23\3\24\3\24\3\24\3\25\3\25\3\25\3\25\3\26\3\26\3\26\3\26\3\27\3\27\3"+
|
||||||
|
"\27\3\27\3\30\3\30\3\30\3\30\3\30\3\31\3\31\3\31\3\31\3\31\3\32\3\32\3"+
|
||||||
|
"\32\3\33\3\33\3\33\3\34\3\34\3\34\3\35\3\35\3\36\3\36\3\37\3\37\3\37\3"+
|
||||||
|
" \3 \3!\3!\3\"\3\"\3\"\3#\3#\3$\3$\3%\3%\3%\3&\3&\3&\3\'\3\'\3\'\3\'\3"+
|
||||||
|
"(\3(\3(\3(\3)\3)\3*\3*\3+\3+\3,\3,\3,\3,\3-\3-\3-\3.\3.\3.\3.\3/\3/\3"+
|
||||||
|
"/\3\60\3\60\3\60\3\61\3\61\3\62\3\62\3\63\3\63\3\63\3\64\3\64\3\64\3\65"+
|
||||||
|
"\3\65\3\66\3\66\3\66\3\66\3\67\3\67\38\38\39\39\3:\3:\3;\3;\3;\3<\3<\3"+
|
||||||
|
"<\3=\3=\3=\3>\3>\3>\3?\3?\3?\3@\3@\3@\3A\3A\3A\3A\3A\3B\3B\3B\3B\3B\3"+
|
||||||
|
"B\3C\3C\7C\u0177\nC\fC\16C\u017a\13C\3C\3C\3D\3D\3D\3D\3E\6E\u0183\nE"+
|
||||||
|
"\rE\16E\u0184\3E\3E\3F\3F\7F\u018b\nF\fF\16F\u018e\13F\3G\3G\3G\6G\u0193"+
|
||||||
|
"\nG\rG\16G\u0194\5G\u0197\nG\3H\3H\6H\u019b\nH\rH\16H\u019c\3I\3I\6I\u01a1"+
|
||||||
|
"\nI\rI\16I\u01a2\3J\3J\3J\5J\u01a8\nJ\3J\5J\u01ab\nJ\3K\6K\u01ae\nK\r"+
|
||||||
|
"K\16K\u01af\3K\3K\6K\u01b4\nK\rK\16K\u01b5\5K\u01b8\nK\3L\3L\3L\3L\5L"+
|
||||||
|
"\u01be\nL\3M\3M\3M\7M\u01c3\nM\fM\16M\u01c6\13M\3M\3M\3M\2\2N\3\3\5\4"+
|
||||||
|
"\7\5\t\6\13\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17\35\20\37\21!\22"+
|
||||||
|
"#\23%\24\'\25)\26+\27-\30/\31\61\32\63\33\65\34\67\359\36;\37= ?!A\"C"+
|
||||||
|
"#E$G%I&K\'M(O)Q*S+U,W-Y.[/]\60_\61a\62c\63e\64g\65i\66k\67m8o9q:s;u<w"+
|
||||||
|
"=y>{?}@\177A\u0081B\u0083C\u0085D\u0087E\u0089F\u008bG\u008dH\u008fI\u0091"+
|
||||||
|
"J\u0093K\u0095\2\u0097\2\u0099L\3\2\n\4\2\f\f\17\17\4\2\13\13\"\"\5\2"+
|
||||||
|
"C\\aac|\6\2\62;C\\aac|\5\2\62;CHch\4\2GGgg\4\2--//\6\2\f\f\16\17$$^^\2"+
|
||||||
|
"\u01d6\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2"+
|
||||||
|
"\r\3\2\2\2\2\17\3\2\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3"+
|
||||||
|
"\2\2\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2!\3\2\2\2"+
|
||||||
|
"\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2\2"+
|
||||||
|
"/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2"+
|
||||||
|
"\2\2;\3\2\2\2\2=\3\2\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2\2"+
|
||||||
|
"G\3\2\2\2\2I\3\2\2\2\2K\3\2\2\2\2M\3\2\2\2\2O\3\2\2\2\2Q\3\2\2\2\2S\3"+
|
||||||
|
"\2\2\2\2U\3\2\2\2\2W\3\2\2\2\2Y\3\2\2\2\2[\3\2\2\2\2]\3\2\2\2\2_\3\2\2"+
|
||||||
|
"\2\2a\3\2\2\2\2c\3\2\2\2\2e\3\2\2\2\2g\3\2\2\2\2i\3\2\2\2\2k\3\2\2\2\2"+
|
||||||
|
"m\3\2\2\2\2o\3\2\2\2\2q\3\2\2\2\2s\3\2\2\2\2u\3\2\2\2\2w\3\2\2\2\2y\3"+
|
||||||
|
"\2\2\2\2{\3\2\2\2\2}\3\2\2\2\2\177\3\2\2\2\2\u0081\3\2\2\2\2\u0083\3\2"+
|
||||||
|
"\2\2\2\u0085\3\2\2\2\2\u0087\3\2\2\2\2\u0089\3\2\2\2\2\u008b\3\2\2\2\2"+
|
||||||
|
"\u008d\3\2\2\2\2\u008f\3\2\2\2\2\u0091\3\2\2\2\2\u0093\3\2\2\2\2\u0099"+
|
||||||
|
"\3\2\2\2\3\u009b\3\2\2\2\5\u009d\3\2\2\2\7\u009f\3\2\2\2\t\u00a1\3\2\2"+
|
||||||
|
"\2\13\u00a7\3\2\2\2\r\u00ae\3\2\2\2\17\u00b3\3\2\2\2\21\u00b8\3\2\2\2"+
|
||||||
|
"\23\u00be\3\2\2\2\25\u00c2\3\2\2\2\27\u00c8\3\2\2\2\31\u00ce\3\2\2\2\33"+
|
||||||
|
"\u00d5\3\2\2\2\35\u00d7\3\2\2\2\37\u00d9\3\2\2\2!\u00dc\3\2\2\2#\u00df"+
|
||||||
|
"\3\2\2\2%\u00e2\3\2\2\2\'\u00e6\3\2\2\2)\u00e9\3\2\2\2+\u00ed\3\2\2\2"+
|
||||||
|
"-\u00f1\3\2\2\2/\u00f5\3\2\2\2\61\u00fa\3\2\2\2\63\u00ff\3\2\2\2\65\u0102"+
|
||||||
|
"\3\2\2\2\67\u0105\3\2\2\29\u0108\3\2\2\2;\u010a\3\2\2\2=\u010c\3\2\2\2"+
|
||||||
|
"?\u010f\3\2\2\2A\u0111\3\2\2\2C\u0113\3\2\2\2E\u0116\3\2\2\2G\u0118\3"+
|
||||||
|
"\2\2\2I\u011a\3\2\2\2K\u011d\3\2\2\2M\u0120\3\2\2\2O\u0124\3\2\2\2Q\u0128"+
|
||||||
|
"\3\2\2\2S\u012a\3\2\2\2U\u012c\3\2\2\2W\u012e\3\2\2\2Y\u0132\3\2\2\2["+
|
||||||
|
"\u0135\3\2\2\2]\u0139\3\2\2\2_\u013c\3\2\2\2a\u013f\3\2\2\2c\u0141\3\2"+
|
||||||
|
"\2\2e\u0143\3\2\2\2g\u0146\3\2\2\2i\u0149\3\2\2\2k\u014b\3\2\2\2m\u014f"+
|
||||||
|
"\3\2\2\2o\u0151\3\2\2\2q\u0153\3\2\2\2s\u0155\3\2\2\2u\u0157\3\2\2\2w"+
|
||||||
|
"\u015a\3\2\2\2y\u015d\3\2\2\2{\u0160\3\2\2\2}\u0163\3\2\2\2\177\u0166"+
|
||||||
|
"\3\2\2\2\u0081\u0169\3\2\2\2\u0083\u016e\3\2\2\2\u0085\u0174\3\2\2\2\u0087"+
|
||||||
|
"\u017d\3\2\2\2\u0089\u0182\3\2\2\2\u008b\u0188\3\2\2\2\u008d\u0196\3\2"+
|
||||||
|
"\2\2\u008f\u0198\3\2\2\2\u0091\u019e\3\2\2\2\u0093\u01a4\3\2\2\2\u0095"+
|
||||||
|
"\u01ad\3\2\2\2\u0097\u01bd\3\2\2\2\u0099\u01bf\3\2\2\2\u009b\u009c\7\'"+
|
||||||
|
"\2\2\u009c\4\3\2\2\2\u009d\u009e\7.\2\2\u009e\6\3\2\2\2\u009f\u00a0\7"+
|
||||||
|
"?\2\2\u00a0\b\3\2\2\2\u00a1\u00a2\7e\2\2\u00a2\u00a3\7q\2\2\u00a3\u00a4"+
|
||||||
|
"\7p\2\2\u00a4\u00a5\7u\2\2\u00a5\u00a6\7v\2\2\u00a6\n\3\2\2\2\u00a7\u00a8"+
|
||||||
|
"\7o\2\2\u00a8\u00a9\7g\2\2\u00a9\u00aa\7o\2\2\u00aa\u00ab\7q\2\2\u00ab"+
|
||||||
|
"\u00ac\7t\2\2\u00ac\u00ad\7{\2\2\u00ad\f\3\2\2\2\u00ae\u00af\7d\2\2\u00af"+
|
||||||
|
"\u00b0\7{\2\2\u00b0\u00b1\7v\2\2\u00b1\u00b2\7g\2\2\u00b2\16\3\2\2\2\u00b3"+
|
||||||
|
"\u00b4\7y\2\2\u00b4\u00b5\7q\2\2\u00b5\u00b6\7t\2\2\u00b6\u00b7\7f\2\2"+
|
||||||
|
"\u00b7\20\3\2\2\2\u00b8\u00b9\7h\2\2\u00b9\u00ba\7n\2\2\u00ba\u00bb\7"+
|
||||||
|
"q\2\2\u00bb\u00bc\7c\2\2\u00bc\u00bd\7v\2\2\u00bd\22\3\2\2\2\u00be\u00bf"+
|
||||||
|
"\7u\2\2\u00bf\u00c0\7v\2\2\u00c0\u00c1\7t\2\2\u00c1\24\3\2\2\2\u00c2\u00c3"+
|
||||||
|
"\7u\2\2\u00c3\u00c4\7v\2\2\u00c4\u00c5\7t\2\2\u00c5\u00c6\7a\2\2\u00c6"+
|
||||||
|
"\u00c7\7r\2\2\u00c7\26\3\2\2\2\u00c8\u00c9\7u\2\2\u00c9\u00ca\7v\2\2\u00ca"+
|
||||||
|
"\u00cb\7t\2\2\u00cb\u00cc\7a\2\2\u00cc\u00cd\7u\2\2\u00cd\30\3\2\2\2\u00ce"+
|
||||||
|
"\u00cf\7u\2\2\u00cf\u00d0\7v\2\2\u00d0\u00d1\7t\2\2\u00d1\u00d2\7a\2\2"+
|
||||||
|
"\u00d2\u00d3\7r\2\2\u00d3\u00d4\7u\2\2\u00d4\32\3\2\2\2\u00d5\u00d6\7"+
|
||||||
|
"]\2\2\u00d6\34\3\2\2\2\u00d7\u00d8\7_\2\2\u00d8\36\3\2\2\2\u00d9\u00da"+
|
||||||
|
"\7-\2\2\u00da\u00db\7?\2\2\u00db \3\2\2\2\u00dc\u00dd\7/\2\2\u00dd\u00de"+
|
||||||
|
"\7?\2\2\u00de\"\3\2\2\2\u00df\u00e0\7\61\2\2\u00e0\u00e1\7?\2\2\u00e1"+
|
||||||
|
"$\3\2\2\2\u00e2\u00e3\7\61\2\2\u00e3\u00e4\7\61\2\2\u00e4\u00e5\7?\2\2"+
|
||||||
|
"\u00e5&\3\2\2\2\u00e6\u00e7\7,\2\2\u00e7\u00e8\7?\2\2\u00e8(\3\2\2\2\u00e9"+
|
||||||
|
"\u00ea\7,\2\2\u00ea\u00eb\7,\2\2\u00eb\u00ec\7?\2\2\u00ec*\3\2\2\2\u00ed"+
|
||||||
|
"\u00ee\7>\2\2\u00ee\u00ef\7>\2\2\u00ef\u00f0\7?\2\2\u00f0,\3\2\2\2\u00f1"+
|
||||||
|
"\u00f2\7@\2\2\u00f2\u00f3\7@\2\2\u00f3\u00f4\7?\2\2\u00f4.\3\2\2\2\u00f5"+
|
||||||
|
"\u00f6\7>\2\2\u00f6\u00f7\7>\2\2\u00f7\u00f8\7B\2\2\u00f8\u00f9\7?\2\2"+
|
||||||
|
"\u00f9\60\3\2\2\2\u00fa\u00fb\7@\2\2\u00fb\u00fc\7@\2\2\u00fc\u00fd\7"+
|
||||||
|
"B\2\2\u00fd\u00fe\7?\2\2\u00fe\62\3\2\2\2\u00ff\u0100\7(\2\2\u0100\u0101"+
|
||||||
|
"\7?\2\2\u0101\64\3\2\2\2\u0102\u0103\7~\2\2\u0103\u0104\7?\2\2\u0104\66"+
|
||||||
|
"\3\2\2\2\u0105\u0106\7`\2\2\u0106\u0107\7?\2\2\u01078\3\2\2\2\u0108\u0109"+
|
||||||
|
"\7*\2\2\u0109:\3\2\2\2\u010a\u010b\7+\2\2\u010b<\3\2\2\2\u010c\u010d\7"+
|
||||||
|
",\2\2\u010d\u010e\7,\2\2\u010e>\3\2\2\2\u010f\u0110\7,\2\2\u0110@\3\2"+
|
||||||
|
"\2\2\u0111\u0112\7\61\2\2\u0112B\3\2\2\2\u0113\u0114\7\61\2\2\u0114\u0115"+
|
||||||
|
"\7\61\2\2\u0115D\3\2\2\2\u0116\u0117\7-\2\2\u0117F\3\2\2\2\u0118\u0119"+
|
||||||
|
"\7/\2\2\u0119H\3\2\2\2\u011a\u011b\7>\2\2\u011b\u011c\7>\2\2\u011cJ\3"+
|
||||||
|
"\2\2\2\u011d\u011e\7@\2\2\u011e\u011f\7@\2\2\u011fL\3\2\2\2\u0120\u0121"+
|
||||||
|
"\7>\2\2\u0121\u0122\7>\2\2\u0122\u0123\7B\2\2\u0123N\3\2\2\2\u0124\u0125"+
|
||||||
|
"\7@\2\2\u0125\u0126\7@\2\2\u0126\u0127\7B\2\2\u0127P\3\2\2\2\u0128\u0129"+
|
||||||
|
"\7(\2\2\u0129R\3\2\2\2\u012a\u012b\7~\2\2\u012bT\3\2\2\2\u012c\u012d\7"+
|
||||||
|
"`\2\2\u012dV\3\2\2\2\u012e\u012f\7c\2\2\u012f\u0130\7p\2\2\u0130\u0131"+
|
||||||
|
"\7f\2\2\u0131X\3\2\2\2\u0132\u0133\7q\2\2\u0133\u0134\7t\2\2\u0134Z\3"+
|
||||||
|
"\2\2\2\u0135\u0136\7z\2\2\u0136\u0137\7q\2\2\u0137\u0138\7t\2\2\u0138"+
|
||||||
|
"\\\3\2\2\2\u0139\u013a\7?\2\2\u013a\u013b\7?\2\2\u013b^\3\2\2\2\u013c"+
|
||||||
|
"\u013d\7#\2\2\u013d\u013e\7?\2\2\u013e`\3\2\2\2\u013f\u0140\7>\2\2\u0140"+
|
||||||
|
"b\3\2\2\2\u0141\u0142\7@\2\2\u0142d\3\2\2\2\u0143\u0144\7>\2\2\u0144\u0145"+
|
||||||
|
"\7?\2\2\u0145f\3\2\2\2\u0146\u0147\7@\2\2\u0147\u0148\7?\2\2\u0148h\3"+
|
||||||
|
"\2\2\2\u0149\u014a\7\u0080\2\2\u014aj\3\2\2\2\u014b\u014c\7p\2\2\u014c"+
|
||||||
|
"\u014d\7q\2\2\u014d\u014e\7v\2\2\u014el\3\2\2\2\u014f\u0150\7\60\2\2\u0150"+
|
||||||
|
"n\3\2\2\2\u0151\u0152\7C\2\2\u0152p\3\2\2\2\u0153\u0154\7Z\2\2\u0154r"+
|
||||||
|
"\3\2\2\2\u0155\u0156\7[\2\2\u0156t\3\2\2\2\u0157\u0158\7C\2\2\u0158\u0159"+
|
||||||
|
"\7Z\2\2\u0159v\3\2\2\2\u015a\u015b\7C\2\2\u015b\u015c\7[\2\2\u015cx\3"+
|
||||||
|
"\2\2\2\u015d\u015e\7Z\2\2\u015e\u015f\7[\2\2\u015fz\3\2\2\2\u0160\u0161"+
|
||||||
|
"\7U\2\2\u0161\u0162\7E\2\2\u0162|\3\2\2\2\u0163\u0164\7U\2\2\u0164\u0165"+
|
||||||
|
"\7K\2\2\u0165~\3\2\2\2\u0166\u0167\7U\2\2\u0167\u0168\7\\\2\2\u0168\u0080"+
|
||||||
|
"\3\2\2\2\u0169\u016a\7v\2\2\u016a\u016b\7t\2\2\u016b\u016c\7w\2\2\u016c"+
|
||||||
|
"\u016d\7g\2\2\u016d\u0082\3\2\2\2\u016e\u016f\7h\2\2\u016f\u0170\7c\2"+
|
||||||
|
"\2\u0170\u0171\7n\2\2\u0171\u0172\7u\2\2\u0172\u0173\7g\2\2\u0173\u0084"+
|
||||||
|
"\3\2\2\2\u0174\u0178\7=\2\2\u0175\u0177\n\2\2\2\u0176\u0175\3\2\2\2\u0177"+
|
||||||
|
"\u017a\3\2\2\2\u0178\u0176\3\2\2\2\u0178\u0179\3\2\2\2\u0179\u017b\3\2"+
|
||||||
|
"\2\2\u017a\u0178\3\2\2\2\u017b\u017c\bC\2\2\u017c\u0086\3\2\2\2\u017d"+
|
||||||
|
"\u017e\t\3\2\2\u017e\u017f\3\2\2\2\u017f\u0180\bD\3\2\u0180\u0088\3\2"+
|
||||||
|
"\2\2\u0181\u0183\t\2\2\2\u0182\u0181\3\2\2\2\u0183\u0184\3\2\2\2\u0184"+
|
||||||
|
"\u0182\3\2\2\2\u0184\u0185\3\2\2\2\u0185\u0186\3\2\2\2\u0186\u0187\bE"+
|
||||||
|
"\3\2\u0187\u008a\3\2\2\2\u0188\u018c\t\4\2\2\u0189\u018b\t\5\2\2\u018a"+
|
||||||
|
"\u0189\3\2\2\2\u018b\u018e\3\2\2\2\u018c\u018a\3\2\2\2\u018c\u018d\3\2"+
|
||||||
|
"\2\2\u018d\u008c\3\2\2\2\u018e\u018c\3\2\2\2\u018f\u0197\4\62;\2\u0190"+
|
||||||
|
"\u0192\4\63;\2\u0191\u0193\4\62;\2\u0192\u0191\3\2\2\2\u0193\u0194\3\2"+
|
||||||
|
"\2\2\u0194\u0192\3\2\2\2\u0194\u0195\3\2\2\2\u0195\u0197\3\2\2\2\u0196"+
|
||||||
|
"\u018f\3\2\2\2\u0196\u0190\3\2\2\2\u0197\u008e\3\2\2\2\u0198\u019a\7&"+
|
||||||
|
"\2\2\u0199\u019b\t\6\2\2\u019a\u0199\3\2\2\2\u019b\u019c\3\2\2\2\u019c"+
|
||||||
|
"\u019a\3\2\2\2\u019c\u019d\3\2\2\2\u019d\u0090\3\2\2\2\u019e\u01a0\7\'"+
|
||||||
|
"\2\2\u019f\u01a1\4\62\63\2\u01a0\u019f\3\2\2\2\u01a1\u01a2\3\2\2\2\u01a2"+
|
||||||
|
"\u01a0\3\2\2\2\u01a2\u01a3\3\2\2\2\u01a3\u0092\3\2\2\2\u01a4\u01aa\5\u0095"+
|
||||||
|
"K\2\u01a5\u01a7\t\7\2\2\u01a6\u01a8\t\b\2\2\u01a7\u01a6\3\2\2\2\u01a7"+
|
||||||
|
"\u01a8\3\2\2\2\u01a8\u01a9\3\2\2\2\u01a9\u01ab\5\u0095K\2\u01aa\u01a5"+
|
||||||
|
"\3\2\2\2\u01aa\u01ab\3\2\2\2\u01ab\u0094\3\2\2\2\u01ac\u01ae\4\62;\2\u01ad"+
|
||||||
|
"\u01ac\3\2\2\2\u01ae\u01af\3\2\2\2\u01af\u01ad\3\2\2\2\u01af\u01b0\3\2"+
|
||||||
|
"\2\2\u01b0\u01b7\3\2\2\2\u01b1\u01b3\7\60\2\2\u01b2\u01b4\4\62;\2\u01b3"+
|
||||||
|
"\u01b2\3\2\2\2\u01b4\u01b5\3\2\2\2\u01b5\u01b3\3\2\2\2\u01b5\u01b6\3\2"+
|
||||||
|
"\2\2\u01b6\u01b8\3\2\2\2\u01b7\u01b1\3\2\2\2\u01b7\u01b8\3\2\2\2\u01b8"+
|
||||||
|
"\u0096\3\2\2\2\u01b9\u01ba\7^\2\2\u01ba\u01be\13\2\2\2\u01bb\u01bc\7^"+
|
||||||
|
"\2\2\u01bc\u01be\5\u0089E\2\u01bd\u01b9\3\2\2\2\u01bd\u01bb\3\2\2\2\u01be"+
|
||||||
|
"\u0098\3\2\2\2\u01bf\u01c4\7$\2\2\u01c0\u01c3\5\u0097L\2\u01c1\u01c3\n"+
|
||||||
|
"\t\2\2\u01c2\u01c0\3\2\2\2\u01c2\u01c1\3\2\2\2\u01c3\u01c6\3\2\2\2\u01c4"+
|
||||||
|
"\u01c2\3\2\2\2\u01c4\u01c5\3\2\2\2\u01c5\u01c7\3\2\2\2\u01c6\u01c4\3\2"+
|
||||||
|
"\2\2\u01c7\u01c8\7$\2\2\u01c8\u01c9\bM\4\2\u01c9\u009a\3\2\2\2\23\2\u0178"+
|
||||||
|
"\u0184\u018c\u0194\u0196\u019a\u019c\u01a2\u01a7\u01aa\u01af\u01b5\u01b7"+
|
||||||
|
"\u01bd\u01c2\u01c4\5\2\3\2\b\2\2\3M\2";
|
||||||
|
public static final ATN _ATN =
|
||||||
|
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
|
||||||
|
static {
|
||||||
|
_decisionToDFA = new DFA[_ATN.getNumberOfDecisions()];
|
||||||
|
for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) {
|
||||||
|
_decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
139
il65/src/il65/parser/il65Lexer.tokens
Normal file
139
il65/src/il65/parser/il65Lexer.tokens
Normal file
@ -0,0 +1,139 @@
|
|||||||
|
T__0=1
|
||||||
|
T__1=2
|
||||||
|
T__2=3
|
||||||
|
T__3=4
|
||||||
|
T__4=5
|
||||||
|
T__5=6
|
||||||
|
T__6=7
|
||||||
|
T__7=8
|
||||||
|
T__8=9
|
||||||
|
T__9=10
|
||||||
|
T__10=11
|
||||||
|
T__11=12
|
||||||
|
T__12=13
|
||||||
|
T__13=14
|
||||||
|
T__14=15
|
||||||
|
T__15=16
|
||||||
|
T__16=17
|
||||||
|
T__17=18
|
||||||
|
T__18=19
|
||||||
|
T__19=20
|
||||||
|
T__20=21
|
||||||
|
T__21=22
|
||||||
|
T__22=23
|
||||||
|
T__23=24
|
||||||
|
T__24=25
|
||||||
|
T__25=26
|
||||||
|
T__26=27
|
||||||
|
T__27=28
|
||||||
|
T__28=29
|
||||||
|
T__29=30
|
||||||
|
T__30=31
|
||||||
|
T__31=32
|
||||||
|
T__32=33
|
||||||
|
T__33=34
|
||||||
|
T__34=35
|
||||||
|
T__35=36
|
||||||
|
T__36=37
|
||||||
|
T__37=38
|
||||||
|
T__38=39
|
||||||
|
T__39=40
|
||||||
|
T__40=41
|
||||||
|
T__41=42
|
||||||
|
T__42=43
|
||||||
|
T__43=44
|
||||||
|
T__44=45
|
||||||
|
T__45=46
|
||||||
|
T__46=47
|
||||||
|
T__47=48
|
||||||
|
T__48=49
|
||||||
|
T__49=50
|
||||||
|
T__50=51
|
||||||
|
T__51=52
|
||||||
|
T__52=53
|
||||||
|
T__53=54
|
||||||
|
T__54=55
|
||||||
|
T__55=56
|
||||||
|
T__56=57
|
||||||
|
T__57=58
|
||||||
|
T__58=59
|
||||||
|
T__59=60
|
||||||
|
T__60=61
|
||||||
|
T__61=62
|
||||||
|
T__62=63
|
||||||
|
T__63=64
|
||||||
|
T__64=65
|
||||||
|
COMMENT=66
|
||||||
|
WS=67
|
||||||
|
EOL=68
|
||||||
|
NAME=69
|
||||||
|
DEC_INTEGER=70
|
||||||
|
HEX_INTEGER=71
|
||||||
|
BIN_INTEGER=72
|
||||||
|
FLOAT_NUMBER=73
|
||||||
|
STRING=74
|
||||||
|
'%'=1
|
||||||
|
','=2
|
||||||
|
'='=3
|
||||||
|
'const'=4
|
||||||
|
'memory'=5
|
||||||
|
'byte'=6
|
||||||
|
'word'=7
|
||||||
|
'float'=8
|
||||||
|
'str'=9
|
||||||
|
'str_p'=10
|
||||||
|
'str_s'=11
|
||||||
|
'str_ps'=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
|
||||||
|
'and'=43
|
||||||
|
'or'=44
|
||||||
|
'xor'=45
|
||||||
|
'=='=46
|
||||||
|
'!='=47
|
||||||
|
'<'=48
|
||||||
|
'>'=49
|
||||||
|
'<='=50
|
||||||
|
'>='=51
|
||||||
|
'~'=52
|
||||||
|
'not'=53
|
||||||
|
'.'=54
|
||||||
|
'A'=55
|
||||||
|
'X'=56
|
||||||
|
'Y'=57
|
||||||
|
'AX'=58
|
||||||
|
'AY'=59
|
||||||
|
'XY'=60
|
||||||
|
'SC'=61
|
||||||
|
'SI'=62
|
||||||
|
'SZ'=63
|
||||||
|
'true'=64
|
||||||
|
'false'=65
|
1591
il65/src/il65/parser/il65Parser.java
Normal file
1591
il65/src/il65/parser/il65Parser.java
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user