mirror of
https://github.com/irmen/prog8.git
synced 2024-11-26 11:49:22 +00:00
for loop body can be a single statement without curly braces now as well
This commit is contained in:
parent
eb74b8daa5
commit
49c3dc3c32
@ -2189,7 +2189,11 @@ private fun prog8Parser.ForloopContext.toAst(): ForLoop {
|
||||
val datatype = datatype()?.toAst()
|
||||
val loopvar = identifier()?.toAst()
|
||||
val iterable = expression()!!.toAst()
|
||||
val scope = AnonymousScope(statement_block().toAst(), statement_block().toPosition())
|
||||
val scope =
|
||||
if(statement()!=null)
|
||||
AnonymousScope(mutableListOf(statement().toAst()), statement().toPosition())
|
||||
else
|
||||
AnonymousScope(statement_block().toAst(), statement_block().toPosition())
|
||||
return ForLoop(loopregister, datatype, loopvar, iterable, scope, toPosition())
|
||||
}
|
||||
|
||||
|
@ -16,15 +16,13 @@
|
||||
|
||||
; use iteration to write text
|
||||
str question = "How are you?\n"
|
||||
for ubyte char in question { ; @todo allow for/while/repeat loops without curly braces just like ifs
|
||||
for ubyte char in question
|
||||
c64.CHROUT(char)
|
||||
}
|
||||
|
||||
; use indexed loop to write characters
|
||||
str bye = "Goodbye!\n"
|
||||
for ubyte c in 0 to len(bye) {
|
||||
for ubyte c in 0 to len(bye)
|
||||
c64.CHROUT(bye[c])
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,17 @@
|
||||
|
||||
sub start() {
|
||||
|
||||
while(true)
|
||||
A++
|
||||
|
||||
|
||||
repeat A++ until(false)
|
||||
|
||||
|
||||
for ubyte i in 0 to 10
|
||||
A++
|
||||
|
||||
|
||||
; c64scr.print_ub(c64utils.str2ubyte("1"))
|
||||
; c64.CHROUT('\n')
|
||||
; c64scr.print_ub(c64utils.str2ubyte("12"))
|
||||
|
@ -255,7 +255,7 @@ branch_stmt : branchcondition EOL? (statement | statement_block) EOL? else_part?
|
||||
branchcondition: 'if_cs' | 'if_cc' | 'if_eq' | 'if_z' | 'if_ne' | 'if_nz' | 'if_pl' | 'if_pos' | 'if_mi' | 'if_neg' | 'if_vs' | 'if_vc' ;
|
||||
|
||||
|
||||
forloop : 'for' datatype? (register | identifier) 'in' expression EOL? statement_block ;
|
||||
forloop : 'for' datatype? (register | identifier) 'in' expression EOL? (statement | statement_block) ;
|
||||
|
||||
whileloop: 'while' expression EOL? (statement | statement_block) ;
|
||||
|
||||
|
@ -17,23 +17,23 @@ public class prog8Lexer extends Lexer {
|
||||
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, T__65=66,
|
||||
T__66=67, T__67=68, T__68=69, T__69=70, T__70=71, T__71=72, T__72=73,
|
||||
T__73=74, T__74=75, T__75=76, T__76=77, T__77=78, T__78=79, T__79=80,
|
||||
T__80=81, T__81=82, T__82=83, T__83=84, T__84=85, T__85=86, T__86=87,
|
||||
T__87=88, T__88=89, T__89=90, T__90=91, T__91=92, T__92=93, T__93=94,
|
||||
T__94=95, T__95=96, T__96=97, T__97=98, T__98=99, T__99=100, T__100=101,
|
||||
T__101=102, T__102=103, T__103=104, T__104=105, T__105=106, T__106=107,
|
||||
T__107=108, T__108=109, T__109=110, T__110=111, T__111=112, LINECOMMENT=113,
|
||||
COMMENT=114, WS=115, EOL=116, NAME=117, DEC_INTEGER=118, HEX_INTEGER=119,
|
||||
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, T__65=66,
|
||||
T__66=67, T__67=68, T__68=69, T__69=70, T__70=71, T__71=72, T__72=73,
|
||||
T__73=74, T__74=75, T__75=76, T__76=77, T__77=78, T__78=79, T__79=80,
|
||||
T__80=81, T__81=82, T__82=83, T__83=84, T__84=85, T__85=86, T__86=87,
|
||||
T__87=88, T__88=89, T__89=90, T__90=91, T__91=92, T__92=93, T__93=94,
|
||||
T__94=95, T__95=96, T__96=97, T__97=98, T__98=99, T__99=100, T__100=101,
|
||||
T__101=102, T__102=103, T__103=104, T__104=105, T__105=106, T__106=107,
|
||||
T__107=108, T__108=109, T__109=110, T__110=111, T__111=112, LINECOMMENT=113,
|
||||
COMMENT=114, WS=115, EOL=116, NAME=117, DEC_INTEGER=118, HEX_INTEGER=119,
|
||||
BIN_INTEGER=120, FLOAT_NUMBER=121, STRING=122, INLINEASMBLOCK=123, SINGLECHAR=124;
|
||||
public static String[] channelNames = {
|
||||
"DEFAULT_TOKEN_CHANNEL", "HIDDEN"
|
||||
@ -45,22 +45,22 @@ public class prog8Lexer extends Lexer {
|
||||
|
||||
private static String[] makeRuleNames() {
|
||||
return new String[] {
|
||||
"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",
|
||||
"T__65", "T__66", "T__67", "T__68", "T__69", "T__70", "T__71", "T__72",
|
||||
"T__73", "T__74", "T__75", "T__76", "T__77", "T__78", "T__79", "T__80",
|
||||
"T__81", "T__82", "T__83", "T__84", "T__85", "T__86", "T__87", "T__88",
|
||||
"T__89", "T__90", "T__91", "T__92", "T__93", "T__94", "T__95", "T__96",
|
||||
"T__97", "T__98", "T__99", "T__100", "T__101", "T__102", "T__103", "T__104",
|
||||
"T__105", "T__106", "T__107", "T__108", "T__109", "T__110", "T__111",
|
||||
"LINECOMMENT", "COMMENT", "WS", "EOL", "NAME", "DEC_INTEGER", "HEX_INTEGER",
|
||||
"BIN_INTEGER", "FLOAT_NUMBER", "FNUMBER", "STRING_ESCAPE_SEQ", "STRING",
|
||||
"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",
|
||||
"T__65", "T__66", "T__67", "T__68", "T__69", "T__70", "T__71", "T__72",
|
||||
"T__73", "T__74", "T__75", "T__76", "T__77", "T__78", "T__79", "T__80",
|
||||
"T__81", "T__82", "T__83", "T__84", "T__85", "T__86", "T__87", "T__88",
|
||||
"T__89", "T__90", "T__91", "T__92", "T__93", "T__94", "T__95", "T__96",
|
||||
"T__97", "T__98", "T__99", "T__100", "T__101", "T__102", "T__103", "T__104",
|
||||
"T__105", "T__106", "T__107", "T__108", "T__109", "T__110", "T__111",
|
||||
"LINECOMMENT", "COMMENT", "WS", "EOL", "NAME", "DEC_INTEGER", "HEX_INTEGER",
|
||||
"BIN_INTEGER", "FLOAT_NUMBER", "FNUMBER", "STRING_ESCAPE_SEQ", "STRING",
|
||||
"INLINEASMBLOCK", "SINGLECHAR"
|
||||
};
|
||||
}
|
||||
@ -68,37 +68,37 @@ public class prog8Lexer extends Lexer {
|
||||
|
||||
private static String[] makeLiteralNames() {
|
||||
return new String[] {
|
||||
null, "'~'", "':'", "'goto'", "'%output'", "'%launcher'", "'%zeropage'",
|
||||
"'%zpreserved'", "'%address'", "'%import'", "'%breakpoint'", "'%asminclude'",
|
||||
"'%asmbinary'", "'%option'", "','", "'='", "'const'", "'memory'", "'ubyte'",
|
||||
"'byte'", "'uword'", "'word'", "'float'", "'str'", "'str_p'", "'str_s'",
|
||||
"'str_ps'", "'['", "']'", "'+='", "'-='", "'/='", "'*='", "'**='", "'&='",
|
||||
"'|='", "'^='", "'%='", "'<<='", "'>>='", "'++'", "'--'", "'+'", "'-'",
|
||||
"'**'", "'*'", "'/'", "'%'", "'<<'", "'>>'", "'<'", "'>'", "'<='", "'>='",
|
||||
"'=='", "'!='", "'&'", "'^'", "'|'", "'to'", "'step'", "'and'", "'or'",
|
||||
"'xor'", "'not'", "'('", "')'", "'as'", "'@'", "'return'", "'break'",
|
||||
"'continue'", "'.'", "'A'", "'X'", "'Y'", "'AX'", "'AY'", "'XY'", "'Pc'",
|
||||
"'Pz'", "'Pn'", "'Pv'", "'.w'", "'true'", "'false'", "'%asm'", "'sub'",
|
||||
"'->'", "'{'", "'}'", "'asmsub'", "'clobbers'", "'stack'", "'if'", "'else'",
|
||||
"'if_cs'", "'if_cc'", "'if_eq'", "'if_z'", "'if_ne'", "'if_nz'", "'if_pl'",
|
||||
"'if_pos'", "'if_mi'", "'if_neg'", "'if_vs'", "'if_vc'", "'for'", "'in'",
|
||||
null, "'~'", "':'", "'goto'", "'%output'", "'%launcher'", "'%zeropage'",
|
||||
"'%zpreserved'", "'%address'", "'%import'", "'%breakpoint'", "'%asminclude'",
|
||||
"'%asmbinary'", "'%option'", "','", "'='", "'const'", "'memory'", "'ubyte'",
|
||||
"'byte'", "'uword'", "'word'", "'float'", "'str'", "'str_p'", "'str_s'",
|
||||
"'str_ps'", "'['", "']'", "'+='", "'-='", "'/='", "'*='", "'**='", "'&='",
|
||||
"'|='", "'^='", "'%='", "'<<='", "'>>='", "'++'", "'--'", "'+'", "'-'",
|
||||
"'**'", "'*'", "'/'", "'%'", "'<<'", "'>>'", "'<'", "'>'", "'<='", "'>='",
|
||||
"'=='", "'!='", "'&'", "'^'", "'|'", "'to'", "'step'", "'and'", "'or'",
|
||||
"'xor'", "'not'", "'('", "')'", "'as'", "'@'", "'return'", "'break'",
|
||||
"'continue'", "'.'", "'A'", "'X'", "'Y'", "'AX'", "'AY'", "'XY'", "'Pc'",
|
||||
"'Pz'", "'Pn'", "'Pv'", "'.w'", "'true'", "'false'", "'%asm'", "'sub'",
|
||||
"'->'", "'{'", "'}'", "'asmsub'", "'clobbers'", "'stack'", "'if'", "'else'",
|
||||
"'if_cs'", "'if_cc'", "'if_eq'", "'if_z'", "'if_ne'", "'if_nz'", "'if_pl'",
|
||||
"'if_pos'", "'if_mi'", "'if_neg'", "'if_vs'", "'if_vc'", "'for'", "'in'",
|
||||
"'while'", "'repeat'", "'until'"
|
||||
};
|
||||
}
|
||||
private static final String[] _LITERAL_NAMES = makeLiteralNames();
|
||||
private static String[] makeSymbolicNames() {
|
||||
return new String[] {
|
||||
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, 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, "LINECOMMENT", "COMMENT", "WS", "EOL",
|
||||
"NAME", "DEC_INTEGER", "HEX_INTEGER", "BIN_INTEGER", "FLOAT_NUMBER",
|
||||
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, 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, "LINECOMMENT", "COMMENT", "WS", "EOL",
|
||||
"NAME", "DEC_INTEGER", "HEX_INTEGER", "BIN_INTEGER", "FLOAT_NUMBER",
|
||||
"STRING", "INLINEASMBLOCK", "SINGLECHAR"
|
||||
};
|
||||
}
|
||||
@ -181,7 +181,7 @@ public class prog8Lexer extends Lexer {
|
||||
// get rid of the enclosing quotes
|
||||
String s = getText();
|
||||
setText(s.substring(1, s.length() - 1));
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -192,7 +192,7 @@ public class prog8Lexer extends Lexer {
|
||||
// get rid of the enclosing double braces
|
||||
String s = getText();
|
||||
setText(s.substring(2, s.length() - 2));
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -203,7 +203,7 @@ public class prog8Lexer extends Lexer {
|
||||
// get rid of the enclosing quotes
|
||||
String s = getText();
|
||||
setText(s.substring(1, s.length() - 1));
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -508,4 +508,4 @@ public class prog8Lexer extends Lexer {
|
||||
_decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -3983,15 +3983,18 @@ public class prog8Parser extends Parser {
|
||||
public ExpressionContext expression() {
|
||||
return getRuleContext(ExpressionContext.class,0);
|
||||
}
|
||||
public Statement_blockContext statement_block() {
|
||||
return getRuleContext(Statement_blockContext.class,0);
|
||||
}
|
||||
public RegisterContext register() {
|
||||
return getRuleContext(RegisterContext.class,0);
|
||||
}
|
||||
public IdentifierContext identifier() {
|
||||
return getRuleContext(IdentifierContext.class,0);
|
||||
}
|
||||
public StatementContext statement() {
|
||||
return getRuleContext(StatementContext.class,0);
|
||||
}
|
||||
public Statement_blockContext statement_block() {
|
||||
return getRuleContext(Statement_blockContext.class,0);
|
||||
}
|
||||
public DatatypeContext datatype() {
|
||||
return getRuleContext(DatatypeContext.class,0);
|
||||
}
|
||||
@ -4055,60 +4058,7 @@ public class prog8Parser extends Parser {
|
||||
}
|
||||
}
|
||||
|
||||
setState(593);
|
||||
statement_block();
|
||||
}
|
||||
}
|
||||
catch (RecognitionException re) {
|
||||
_localctx.exception = re;
|
||||
_errHandler.reportError(this, re);
|
||||
_errHandler.recover(this, re);
|
||||
}
|
||||
finally {
|
||||
exitRule();
|
||||
}
|
||||
return _localctx;
|
||||
}
|
||||
|
||||
public static class WhileloopContext extends ParserRuleContext {
|
||||
public ExpressionContext expression() {
|
||||
return getRuleContext(ExpressionContext.class,0);
|
||||
}
|
||||
public StatementContext statement() {
|
||||
return getRuleContext(StatementContext.class,0);
|
||||
}
|
||||
public Statement_blockContext statement_block() {
|
||||
return getRuleContext(Statement_blockContext.class,0);
|
||||
}
|
||||
public TerminalNode EOL() { return getToken(prog8Parser.EOL, 0); }
|
||||
public WhileloopContext(ParserRuleContext parent, int invokingState) {
|
||||
super(parent, invokingState);
|
||||
}
|
||||
@Override public int getRuleIndex() { return RULE_whileloop; }
|
||||
}
|
||||
|
||||
public final WhileloopContext whileloop() throws RecognitionException {
|
||||
WhileloopContext _localctx = new WhileloopContext(_ctx, getState());
|
||||
enterRule(_localctx, 120, RULE_whileloop);
|
||||
int _la;
|
||||
try {
|
||||
enterOuterAlt(_localctx, 1);
|
||||
{
|
||||
setState(595);
|
||||
match(T__109);
|
||||
setState(596);
|
||||
expression(0);
|
||||
setState(598);
|
||||
_errHandler.sync(this);
|
||||
_la = _input.LA(1);
|
||||
if (_la==EOL) {
|
||||
{
|
||||
setState(597);
|
||||
match(EOL);
|
||||
}
|
||||
}
|
||||
|
||||
setState(602);
|
||||
_errHandler.sync(this);
|
||||
switch (_input.LA(1)) {
|
||||
case T__2:
|
||||
@ -4161,13 +4111,130 @@ public class prog8Parser extends Parser {
|
||||
case T__110:
|
||||
case NAME:
|
||||
{
|
||||
setState(600);
|
||||
setState(593);
|
||||
statement();
|
||||
}
|
||||
break;
|
||||
case T__88:
|
||||
{
|
||||
setState(601);
|
||||
setState(594);
|
||||
statement_block();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new NoViableAltException(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (RecognitionException re) {
|
||||
_localctx.exception = re;
|
||||
_errHandler.reportError(this, re);
|
||||
_errHandler.recover(this, re);
|
||||
}
|
||||
finally {
|
||||
exitRule();
|
||||
}
|
||||
return _localctx;
|
||||
}
|
||||
|
||||
public static class WhileloopContext extends ParserRuleContext {
|
||||
public ExpressionContext expression() {
|
||||
return getRuleContext(ExpressionContext.class,0);
|
||||
}
|
||||
public StatementContext statement() {
|
||||
return getRuleContext(StatementContext.class,0);
|
||||
}
|
||||
public Statement_blockContext statement_block() {
|
||||
return getRuleContext(Statement_blockContext.class,0);
|
||||
}
|
||||
public TerminalNode EOL() { return getToken(prog8Parser.EOL, 0); }
|
||||
public WhileloopContext(ParserRuleContext parent, int invokingState) {
|
||||
super(parent, invokingState);
|
||||
}
|
||||
@Override public int getRuleIndex() { return RULE_whileloop; }
|
||||
}
|
||||
|
||||
public final WhileloopContext whileloop() throws RecognitionException {
|
||||
WhileloopContext _localctx = new WhileloopContext(_ctx, getState());
|
||||
enterRule(_localctx, 120, RULE_whileloop);
|
||||
int _la;
|
||||
try {
|
||||
enterOuterAlt(_localctx, 1);
|
||||
{
|
||||
setState(597);
|
||||
match(T__109);
|
||||
setState(598);
|
||||
expression(0);
|
||||
setState(600);
|
||||
_errHandler.sync(this);
|
||||
_la = _input.LA(1);
|
||||
if (_la==EOL) {
|
||||
{
|
||||
setState(599);
|
||||
match(EOL);
|
||||
}
|
||||
}
|
||||
|
||||
setState(604);
|
||||
_errHandler.sync(this);
|
||||
switch (_input.LA(1)) {
|
||||
case T__2:
|
||||
case T__3:
|
||||
case T__4:
|
||||
case T__5:
|
||||
case T__6:
|
||||
case T__7:
|
||||
case T__8:
|
||||
case T__9:
|
||||
case T__10:
|
||||
case T__11:
|
||||
case T__12:
|
||||
case T__15:
|
||||
case T__16:
|
||||
case T__17:
|
||||
case T__18:
|
||||
case T__19:
|
||||
case T__20:
|
||||
case T__21:
|
||||
case T__22:
|
||||
case T__23:
|
||||
case T__24:
|
||||
case T__25:
|
||||
case T__67:
|
||||
case T__68:
|
||||
case T__69:
|
||||
case T__70:
|
||||
case T__72:
|
||||
case T__73:
|
||||
case T__74:
|
||||
case T__85:
|
||||
case T__86:
|
||||
case T__90:
|
||||
case T__93:
|
||||
case T__95:
|
||||
case T__96:
|
||||
case T__97:
|
||||
case T__98:
|
||||
case T__99:
|
||||
case T__100:
|
||||
case T__101:
|
||||
case T__102:
|
||||
case T__103:
|
||||
case T__104:
|
||||
case T__105:
|
||||
case T__106:
|
||||
case T__107:
|
||||
case T__109:
|
||||
case T__110:
|
||||
case NAME:
|
||||
{
|
||||
setState(602);
|
||||
statement();
|
||||
}
|
||||
break;
|
||||
case T__88:
|
||||
{
|
||||
setState(603);
|
||||
statement_block();
|
||||
}
|
||||
break;
|
||||
@ -4211,9 +4278,9 @@ public class prog8Parser extends Parser {
|
||||
try {
|
||||
enterOuterAlt(_localctx, 1);
|
||||
{
|
||||
setState(604);
|
||||
setState(606);
|
||||
match(T__110);
|
||||
setState(607);
|
||||
setState(609);
|
||||
_errHandler.sync(this);
|
||||
switch (_input.LA(1)) {
|
||||
case T__2:
|
||||
@ -4266,32 +4333,32 @@ public class prog8Parser extends Parser {
|
||||
case T__110:
|
||||
case NAME:
|
||||
{
|
||||
setState(605);
|
||||
setState(607);
|
||||
statement();
|
||||
}
|
||||
break;
|
||||
case T__88:
|
||||
{
|
||||
setState(606);
|
||||
setState(608);
|
||||
statement_block();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new NoViableAltException(this);
|
||||
}
|
||||
setState(610);
|
||||
setState(612);
|
||||
_errHandler.sync(this);
|
||||
_la = _input.LA(1);
|
||||
if (_la==EOL) {
|
||||
{
|
||||
setState(609);
|
||||
setState(611);
|
||||
match(EOL);
|
||||
}
|
||||
}
|
||||
|
||||
setState(612);
|
||||
setState(614);
|
||||
match(T__111);
|
||||
setState(613);
|
||||
setState(615);
|
||||
expression(0);
|
||||
}
|
||||
}
|
||||
@ -4348,7 +4415,7 @@ public class prog8Parser extends Parser {
|
||||
}
|
||||
|
||||
public static final String _serializedATN =
|
||||
"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3~\u026a\4\2\t\2\4"+
|
||||
"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3~\u026c\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"+
|
||||
@ -4391,50 +4458,50 @@ public class prog8Parser extends Parser {
|
||||
"\u0225\n9\39\59\u0228\n9\39\59\u022b\n9\3:\3:\5:\u022f\n:\3:\3:\5:\u0233"+
|
||||
"\n:\3;\3;\5;\u0237\n;\3;\3;\5;\u023b\n;\3;\5;\u023e\n;\3;\5;\u0241\n;"+
|
||||
"\3;\3;\3<\3<\3=\3=\5=\u0249\n=\3=\3=\5=\u024d\n=\3=\3=\3=\5=\u0252\n="+
|
||||
"\3=\3=\3>\3>\3>\5>\u0259\n>\3>\3>\5>\u025d\n>\3?\3?\3?\5?\u0262\n?\3?"+
|
||||
"\5?\u0265\n?\3?\3?\3?\3?\2\3(@\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36"+
|
||||
" \"$&(*,.\60\62\64\668:<>@BDFHJLNPRTVXZ\\^`bdfhjlnprtvxz|\2\22\3\2\6\17"+
|
||||
"\3\2\24\34\3\2\37)\3\2*+\4\2\3\3,-\3\2/\61\3\2,-\3\2\62\63\3\2\64\67\3"+
|
||||
"\289\3\2KM\3\2KP\3\2QT\3\2xz\3\2VW\3\2bm\2\u029d\2\u0082\3\2\2\2\4\u0089"+
|
||||
"\3\2\2\2\6\u008b\3\2\2\2\b\u00a9\3\2\2\2\n\u00ab\3\2\2\2\f\u00ae\3\2\2"+
|
||||
"\2\16\u00b3\3\2\2\2\20\u00c4\3\2\2\2\22\u00c6\3\2\2\2\24\u00cc\3\2\2\2"+
|
||||
"\26\u00d4\3\2\2\2\30\u00d7\3\2\2\2\32\u00da\3\2\2\2\34\u00dc\3\2\2\2\36"+
|
||||
"\u00e0\3\2\2\2 \u00e4\3\2\2\2\"\u00ec\3\2\2\2$\u00f4\3\2\2\2&\u00f6\3"+
|
||||
"\2\2\2(\u0108\3\2\2\2*\u013c\3\2\2\2,\u013f\3\2\2\2.\u0142\3\2\2\2\60"+
|
||||
"\u0147\3\2\2\2\62\u014e\3\2\2\2\64\u0155\3\2\2\2\66\u0160\3\2\2\28\u0164"+
|
||||
"\3\2\2\2:\u0166\3\2\2\2<\u0168\3\2\2\2>\u016a\3\2\2\2@\u0172\3\2\2\2B"+
|
||||
"\u0174\3\2\2\2D\u0176\3\2\2\2F\u0178\3\2\2\2H\u017c\3\2\2\2J\u017e\3\2"+
|
||||
"\2\2L\u0180\3\2\2\2N\u0194\3\2\2\2P\u0196\3\2\2\2R\u0198\3\2\2\2T\u01a0"+
|
||||
"\3\2\2\2V\u01a2\3\2\2\2X\u01a5\3\2\2\2Z\u01b2\3\2\2\2\\\u01b5\3\2\2\2"+
|
||||
"^\u01c0\3\2\2\2`\u01cb\3\2\2\2b\u01d6\3\2\2\2d\u01ee\3\2\2\2f\u01f1\3"+
|
||||
"\2\2\2h\u01fc\3\2\2\2j\u0203\3\2\2\2l\u020b\3\2\2\2n\u0216\3\2\2\2p\u021d"+
|
||||
"\3\2\2\2r\u022c\3\2\2\2t\u0234\3\2\2\2v\u0244\3\2\2\2x\u0246\3\2\2\2z"+
|
||||
"\u0255\3\2\2\2|\u025e\3\2\2\2~\u0081\5\4\3\2\177\u0081\7v\2\2\u0080~\3"+
|
||||
"\2\2\2\u0080\177\3\2\2\2\u0081\u0084\3\2\2\2\u0082\u0080\3\2\2\2\u0082"+
|
||||
"\u0083\3\2\2\2\u0083\u0085\3\2\2\2\u0084\u0082\3\2\2\2\u0085\u0086\7\2"+
|
||||
"\2\3\u0086\3\3\2\2\2\u0087\u008a\5\16\b\2\u0088\u008a\5\6\4\2\u0089\u0087"+
|
||||
"\3\2\2\2\u0089\u0088\3\2\2\2\u008a\5\3\2\2\2\u008b\u008c\7\3\2\2\u008c"+
|
||||
"\u008e\5<\37\2\u008d\u008f\5F$\2\u008e\u008d\3\2\2\2\u008e\u008f\3\2\2"+
|
||||
"\2\u008f\u0090\3\2\2\2\u0090\u0091\5\\/\2\u0091\u0092\7v\2\2\u0092\7\3"+
|
||||
"\2\2\2\u0093\u00aa\5\16\b\2\u0094\u00aa\5\24\13\2\u0095\u00aa\5\22\n\2"+
|
||||
"\u0096\u00aa\5\26\f\2\u0097\u00aa\5\30\r\2\u0098\u00aa\5\36\20\2\u0099"+
|
||||
"\u00aa\5\"\22\2\u009a\u00aa\5\f\7\2\u009b\u00aa\5&\24\2\u009c\u00aa\5"+
|
||||
"\62\32\2\u009d\u00aa\5p9\2\u009e\u00aa\5t;\2\u009f\u00aa\5X-\2\u00a0\u00aa"+
|
||||
"\5b\62\2\u00a1\u00aa\5V,\2\u00a2\u00aa\5\66\34\2\u00a3\u00aa\5x=\2\u00a4"+
|
||||
"\u00aa\5z>\2\u00a5\u00aa\5|?\2\u00a6\u00aa\58\35\2\u00a7\u00aa\5:\36\2"+
|
||||
"\u00a8\u00aa\5\n\6\2\u00a9\u0093\3\2\2\2\u00a9\u0094\3\2\2\2\u00a9\u0095"+
|
||||
"\3\2\2\2\u00a9\u0096\3\2\2\2\u00a9\u0097\3\2\2\2\u00a9\u0098\3\2\2\2\u00a9"+
|
||||
"\u0099\3\2\2\2\u00a9\u009a\3\2\2\2\u00a9\u009b\3\2\2\2\u00a9\u009c\3\2"+
|
||||
"\2\2\u00a9\u009d\3\2\2\2\u00a9\u009e\3\2\2\2\u00a9\u009f\3\2\2\2\u00a9"+
|
||||
"\u00a0\3\2\2\2\u00a9\u00a1\3\2\2\2\u00a9\u00a2\3\2\2\2\u00a9\u00a3\3\2"+
|
||||
"\2\2\u00a9\u00a4\3\2\2\2\u00a9\u00a5\3\2\2\2\u00a9\u00a6\3\2\2\2\u00a9"+
|
||||
"\u00a7\3\2\2\2\u00a9\u00a8\3\2\2\2\u00aa\t\3\2\2\2\u00ab\u00ac\5<\37\2"+
|
||||
"\u00ac\u00ad\7\4\2\2\u00ad\13\3\2\2\2\u00ae\u00b1\7\5\2\2\u00af\u00b2"+
|
||||
"\5F$\2\u00b0\u00b2\5> \2\u00b1\u00af\3\2\2\2\u00b1\u00b0\3\2\2\2\u00b2"+
|
||||
"\r\3\2\2\2\u00b3\u00bf\t\2\2\2\u00b4\u00b6\5\20\t\2\u00b5\u00b4\3\2\2"+
|
||||
"\2\u00b5\u00b6\3\2\2\2\u00b6\u00c0\3\2\2\2\u00b7\u00bc\5\20\t\2\u00b8"+
|
||||
"\u00b9\7\20\2\2\u00b9\u00bb\5\20\t\2\u00ba\u00b8\3\2\2\2\u00bb\u00be\3"+
|
||||
"\2\2\2\u00bc\u00ba\3\2\2\2\u00bc\u00bd\3\2\2\2\u00bd\u00c0\3\2\2\2\u00be"+
|
||||
"\3=\3=\5=\u0256\n=\3>\3>\3>\5>\u025b\n>\3>\3>\5>\u025f\n>\3?\3?\3?\5?"+
|
||||
"\u0264\n?\3?\5?\u0267\n?\3?\3?\3?\3?\2\3(@\2\4\6\b\n\f\16\20\22\24\26"+
|
||||
"\30\32\34\36 \"$&(*,.\60\62\64\668:<>@BDFHJLNPRTVXZ\\^`bdfhjlnprtvxz|"+
|
||||
"\2\22\3\2\6\17\3\2\24\34\3\2\37)\3\2*+\4\2\3\3,-\3\2/\61\3\2,-\3\2\62"+
|
||||
"\63\3\2\64\67\3\289\3\2KM\3\2KP\3\2QT\3\2xz\3\2VW\3\2bm\2\u02a0\2\u0082"+
|
||||
"\3\2\2\2\4\u0089\3\2\2\2\6\u008b\3\2\2\2\b\u00a9\3\2\2\2\n\u00ab\3\2\2"+
|
||||
"\2\f\u00ae\3\2\2\2\16\u00b3\3\2\2\2\20\u00c4\3\2\2\2\22\u00c6\3\2\2\2"+
|
||||
"\24\u00cc\3\2\2\2\26\u00d4\3\2\2\2\30\u00d7\3\2\2\2\32\u00da\3\2\2\2\34"+
|
||||
"\u00dc\3\2\2\2\36\u00e0\3\2\2\2 \u00e4\3\2\2\2\"\u00ec\3\2\2\2$\u00f4"+
|
||||
"\3\2\2\2&\u00f6\3\2\2\2(\u0108\3\2\2\2*\u013c\3\2\2\2,\u013f\3\2\2\2."+
|
||||
"\u0142\3\2\2\2\60\u0147\3\2\2\2\62\u014e\3\2\2\2\64\u0155\3\2\2\2\66\u0160"+
|
||||
"\3\2\2\28\u0164\3\2\2\2:\u0166\3\2\2\2<\u0168\3\2\2\2>\u016a\3\2\2\2@"+
|
||||
"\u0172\3\2\2\2B\u0174\3\2\2\2D\u0176\3\2\2\2F\u0178\3\2\2\2H\u017c\3\2"+
|
||||
"\2\2J\u017e\3\2\2\2L\u0180\3\2\2\2N\u0194\3\2\2\2P\u0196\3\2\2\2R\u0198"+
|
||||
"\3\2\2\2T\u01a0\3\2\2\2V\u01a2\3\2\2\2X\u01a5\3\2\2\2Z\u01b2\3\2\2\2\\"+
|
||||
"\u01b5\3\2\2\2^\u01c0\3\2\2\2`\u01cb\3\2\2\2b\u01d6\3\2\2\2d\u01ee\3\2"+
|
||||
"\2\2f\u01f1\3\2\2\2h\u01fc\3\2\2\2j\u0203\3\2\2\2l\u020b\3\2\2\2n\u0216"+
|
||||
"\3\2\2\2p\u021d\3\2\2\2r\u022c\3\2\2\2t\u0234\3\2\2\2v\u0244\3\2\2\2x"+
|
||||
"\u0246\3\2\2\2z\u0257\3\2\2\2|\u0260\3\2\2\2~\u0081\5\4\3\2\177\u0081"+
|
||||
"\7v\2\2\u0080~\3\2\2\2\u0080\177\3\2\2\2\u0081\u0084\3\2\2\2\u0082\u0080"+
|
||||
"\3\2\2\2\u0082\u0083\3\2\2\2\u0083\u0085\3\2\2\2\u0084\u0082\3\2\2\2\u0085"+
|
||||
"\u0086\7\2\2\3\u0086\3\3\2\2\2\u0087\u008a\5\16\b\2\u0088\u008a\5\6\4"+
|
||||
"\2\u0089\u0087\3\2\2\2\u0089\u0088\3\2\2\2\u008a\5\3\2\2\2\u008b\u008c"+
|
||||
"\7\3\2\2\u008c\u008e\5<\37\2\u008d\u008f\5F$\2\u008e\u008d\3\2\2\2\u008e"+
|
||||
"\u008f\3\2\2\2\u008f\u0090\3\2\2\2\u0090\u0091\5\\/\2\u0091\u0092\7v\2"+
|
||||
"\2\u0092\7\3\2\2\2\u0093\u00aa\5\16\b\2\u0094\u00aa\5\24\13\2\u0095\u00aa"+
|
||||
"\5\22\n\2\u0096\u00aa\5\26\f\2\u0097\u00aa\5\30\r\2\u0098\u00aa\5\36\20"+
|
||||
"\2\u0099\u00aa\5\"\22\2\u009a\u00aa\5\f\7\2\u009b\u00aa\5&\24\2\u009c"+
|
||||
"\u00aa\5\62\32\2\u009d\u00aa\5p9\2\u009e\u00aa\5t;\2\u009f\u00aa\5X-\2"+
|
||||
"\u00a0\u00aa\5b\62\2\u00a1\u00aa\5V,\2\u00a2\u00aa\5\66\34\2\u00a3\u00aa"+
|
||||
"\5x=\2\u00a4\u00aa\5z>\2\u00a5\u00aa\5|?\2\u00a6\u00aa\58\35\2\u00a7\u00aa"+
|
||||
"\5:\36\2\u00a8\u00aa\5\n\6\2\u00a9\u0093\3\2\2\2\u00a9\u0094\3\2\2\2\u00a9"+
|
||||
"\u0095\3\2\2\2\u00a9\u0096\3\2\2\2\u00a9\u0097\3\2\2\2\u00a9\u0098\3\2"+
|
||||
"\2\2\u00a9\u0099\3\2\2\2\u00a9\u009a\3\2\2\2\u00a9\u009b\3\2\2\2\u00a9"+
|
||||
"\u009c\3\2\2\2\u00a9\u009d\3\2\2\2\u00a9\u009e\3\2\2\2\u00a9\u009f\3\2"+
|
||||
"\2\2\u00a9\u00a0\3\2\2\2\u00a9\u00a1\3\2\2\2\u00a9\u00a2\3\2\2\2\u00a9"+
|
||||
"\u00a3\3\2\2\2\u00a9\u00a4\3\2\2\2\u00a9\u00a5\3\2\2\2\u00a9\u00a6\3\2"+
|
||||
"\2\2\u00a9\u00a7\3\2\2\2\u00a9\u00a8\3\2\2\2\u00aa\t\3\2\2\2\u00ab\u00ac"+
|
||||
"\5<\37\2\u00ac\u00ad\7\4\2\2\u00ad\13\3\2\2\2\u00ae\u00b1\7\5\2\2\u00af"+
|
||||
"\u00b2\5F$\2\u00b0\u00b2\5> \2\u00b1\u00af\3\2\2\2\u00b1\u00b0\3\2\2\2"+
|
||||
"\u00b2\r\3\2\2\2\u00b3\u00bf\t\2\2\2\u00b4\u00b6\5\20\t\2\u00b5\u00b4"+
|
||||
"\3\2\2\2\u00b5\u00b6\3\2\2\2\u00b6\u00c0\3\2\2\2\u00b7\u00bc\5\20\t\2"+
|
||||
"\u00b8\u00b9\7\20\2\2\u00b9\u00bb\5\20\t\2\u00ba\u00b8\3\2\2\2\u00bb\u00be"+
|
||||
"\3\2\2\2\u00bc\u00ba\3\2\2\2\u00bc\u00bd\3\2\2\2\u00bd\u00c0\3\2\2\2\u00be"+
|
||||
"\u00bc\3\2\2\2\u00bf\u00b5\3\2\2\2\u00bf\u00b7\3\2\2\2\u00c0\17\3\2\2"+
|
||||
"\2\u00c1\u00c5\5N(\2\u00c2\u00c5\5<\37\2\u00c3\u00c5\5F$\2\u00c4\u00c1"+
|
||||
"\3\2\2\2\u00c4\u00c2\3\2\2\2\u00c4\u00c3\3\2\2\2\u00c5\21\3\2\2\2\u00c6"+
|
||||
@ -4568,19 +4635,20 @@ public class prog8Parser extends Parser {
|
||||
"\2\2\2\u0249\u024c\3\2\2\2\u024a\u024d\5@!\2\u024b\u024d\5<\37\2\u024c"+
|
||||
"\u024a\3\2\2\2\u024c\u024b\3\2\2\2\u024d\u024e\3\2\2\2\u024e\u024f\7o"+
|
||||
"\2\2\u024f\u0251\5(\25\2\u0250\u0252\7v\2\2\u0251\u0250\3\2\2\2\u0251"+
|
||||
"\u0252\3\2\2\2\u0252\u0253\3\2\2\2\u0253\u0254\5\\/\2\u0254y\3\2\2\2\u0255"+
|
||||
"\u0256\7p\2\2\u0256\u0258\5(\25\2\u0257\u0259\7v\2\2\u0258\u0257\3\2\2"+
|
||||
"\2\u0258\u0259\3\2\2\2\u0259\u025c\3\2\2\2\u025a\u025d\5\b\5\2\u025b\u025d"+
|
||||
"\5\\/\2\u025c\u025a\3\2\2\2\u025c\u025b\3\2\2\2\u025d{\3\2\2\2\u025e\u0261"+
|
||||
"\7q\2\2\u025f\u0262\5\b\5\2\u0260\u0262\5\\/\2\u0261\u025f\3\2\2\2\u0261"+
|
||||
"\u0260\3\2\2\2\u0262\u0264\3\2\2\2\u0263\u0265\7v\2\2\u0264\u0263\3\2"+
|
||||
"\2\2\u0264\u0265\3\2\2\2\u0265\u0266\3\2\2\2\u0266\u0267\7r\2\2\u0267"+
|
||||
"\u0268\5(\25\2\u0268}\3\2\2\2D\u0080\u0082\u0089\u008e\u00a9\u00b1\u00b5"+
|
||||
"\u0252\3\2\2\2\u0252\u0255\3\2\2\2\u0253\u0256\5\b\5\2\u0254\u0256\5\\"+
|
||||
"/\2\u0255\u0253\3\2\2\2\u0255\u0254\3\2\2\2\u0256y\3\2\2\2\u0257\u0258"+
|
||||
"\7p\2\2\u0258\u025a\5(\25\2\u0259\u025b\7v\2\2\u025a\u0259\3\2\2\2\u025a"+
|
||||
"\u025b\3\2\2\2\u025b\u025e\3\2\2\2\u025c\u025f\5\b\5\2\u025d\u025f\5\\"+
|
||||
"/\2\u025e\u025c\3\2\2\2\u025e\u025d\3\2\2\2\u025f{\3\2\2\2\u0260\u0263"+
|
||||
"\7q\2\2\u0261\u0264\5\b\5\2\u0262\u0264\5\\/\2\u0263\u0261\3\2\2\2\u0263"+
|
||||
"\u0262\3\2\2\2\u0264\u0266\3\2\2\2\u0265\u0267\7v\2\2\u0266\u0265\3\2"+
|
||||
"\2\2\u0266\u0267\3\2\2\2\u0267\u0268\3\2\2\2\u0268\u0269\7r\2\2\u0269"+
|
||||
"\u026a\5(\25\2\u026a}\3\2\2\2E\u0080\u0082\u0089\u008e\u00a9\u00b1\u00b5"+
|
||||
"\u00bc\u00bf\u00c4\u00c8\u00ce\u00e9\u00f4\u0108\u0133\u0137\u0139\u014a"+
|
||||
"\u0151\u0158\u015d\u0162\u016f\u017a\u0182\u0187\u018c\u0190\u01a0\u01a9"+
|
||||
"\u01ad\u01b9\u01bb\u01c3\u01c8\u01ce\u01d3\u01da\u01e1\u01e7\u01ec\u01f4"+
|
||||
"\u01f9\u0201\u0208\u020e\u0213\u021b\u0220\u0224\u0227\u022a\u022e\u0232"+
|
||||
"\u0236\u023a\u023d\u0240\u0248\u024c\u0251\u0258\u025c\u0261\u0264";
|
||||
"\u0236\u023a\u023d\u0240\u0248\u024c\u0251\u0255\u025a\u025e\u0263\u0266";
|
||||
public static final ATN _ATN =
|
||||
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
|
||||
static {
|
||||
|
Loading…
Reference in New Issue
Block a user