1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-08-02 09:29:35 +00:00

Allowing last asm line without newline

This commit is contained in:
jespergravgaard 2017-05-20 22:05:01 +02:00
parent 8f9f042144
commit da8ff513e6
22 changed files with 198 additions and 107 deletions

View File

@ -1 +1 @@
ldx #{coby1} ldx #{coby1}

View File

@ -1,2 +1,2 @@
cpx #0 cpx #0
bne {la1} bne {la1}

View File

@ -8,4 +8,4 @@
!t: !t:
LDA #$ff LDA #$ff
!d: !d:
STA {zpbo1} STA {zpbo1}

View File

@ -5,4 +5,4 @@ beq !t+
!f: lda #0 !f: lda #0
jmp !d+ jmp !d+
!t: lda #$ff !t: lda #$ff
!d: sta {zpbo1 !d: sta {zpbo1

View File

@ -4,4 +4,4 @@ bcc !t+
!f: lda #0 !f: lda #0
jmp !d+ jmp !d+
!t: lda #$ff !t: lda #$ff
!d: sta {zpbo1} !d: sta {zpbo1}

View File

@ -1,2 +1,2 @@
lda #{coby1} lda #{coby1}
sta {zpby1} sta {zpby1}

View File

@ -1,2 +1,2 @@
lda {zpby2} lda {zpby2}
sta {zpby1} sta {zpby1}

View File

@ -1,4 +1,4 @@
lda {zpby2} lda {zpby2}
sec sec
sbc #1 sbc #1
sta {zpby1} sta {zpby1}

View File

@ -1,4 +1,4 @@
lda {zpby2} lda {zpby2}
sec sec
sbc #{coby1} sbc #{coby1}
sta {zpby1} sta {zpby1}

View File

@ -1,4 +1,4 @@
lda {zpby1} lda {zpby1}
clc clc
adc #1 adc #1
sta {zpby2} sta {zpby2}

View File

@ -1,4 +1,4 @@
lda {zpby2} lda {zpby2}
clc clc
adc {zpby3} adc {zpby3}
sta {zpby1} sta {zpby1}

View File

@ -1,2 +1,2 @@
lda {zpby1} lda {zpby1}
bne {la1} bne {la1}

View File

@ -2,4 +2,4 @@ lda {zpby1}
cmp #{coby1} cmp #{coby1}
beq !+ beq !+
bcs {la1} bcs {la1}
!: !:

View File

@ -1,3 +1,3 @@
lda {zpby1} lda {zpby1}
cmp #{coby1} cmp #{coby1}
bcc {la1} bcc {la1}

View File

@ -6,11 +6,15 @@ file :
; ;
lineSeq lineSeq
: line+ : line ( nline*)
;
nline
: '\n' line
; ;
line line
: label? instruction? comment? '\n' : label? instruction? comment?
; ;
label label

View File

@ -35,6 +35,18 @@ public class Asm6502BaseListener implements Asm6502Listener {
* <p>The default implementation does nothing.</p> * <p>The default implementation does nothing.</p>
*/ */
@Override public void exitLineSeq(Asm6502Parser.LineSeqContext ctx) { } @Override public void exitLineSeq(Asm6502Parser.LineSeqContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterNline(Asm6502Parser.NlineContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitNline(Asm6502Parser.NlineContext ctx) { }
/** /**
* {@inheritDoc} * {@inheritDoc}
* *

View File

@ -25,6 +25,13 @@ public class Asm6502BaseVisitor<T> extends AbstractParseTreeVisitor<T> implement
* {@link #visitChildren} on {@code ctx}.</p> * {@link #visitChildren} on {@code ctx}.</p>
*/ */
@Override public T visitLineSeq(Asm6502Parser.LineSeqContext ctx) { return visitChildren(ctx); } @Override public T visitLineSeq(Asm6502Parser.LineSeqContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitNline(Asm6502Parser.NlineContext ctx) { return visitChildren(ctx); }
/** /**
* {@inheritDoc} * {@inheritDoc}
* *

View File

@ -27,6 +27,16 @@ public interface Asm6502Listener extends ParseTreeListener {
* @param ctx the parse tree * @param ctx the parse tree
*/ */
void exitLineSeq(Asm6502Parser.LineSeqContext ctx); void exitLineSeq(Asm6502Parser.LineSeqContext ctx);
/**
* Enter a parse tree produced by {@link Asm6502Parser#nline}.
* @param ctx the parse tree
*/
void enterNline(Asm6502Parser.NlineContext ctx);
/**
* Exit a parse tree produced by {@link Asm6502Parser#nline}.
* @param ctx the parse tree
*/
void exitNline(Asm6502Parser.NlineContext ctx);
/** /**
* Enter a parse tree produced by {@link Asm6502Parser#line}. * Enter a parse tree produced by {@link Asm6502Parser#line}.
* @param ctx the parse tree * @param ctx the parse tree

View File

@ -21,11 +21,11 @@ public class Asm6502Parser extends Parser {
T__9=10, MNEMONIC=11, NUMINT=12, BININTEGER=13, DECINTEGER=14, HEXINTEGER=15, T__9=10, MNEMONIC=11, NUMINT=12, BININTEGER=13, DECINTEGER=14, HEXINTEGER=15,
NAME=16, WS=17; NAME=16, WS=17;
public static final int public static final int
RULE_file = 0, RULE_lineSeq = 1, RULE_line = 2, RULE_label = 3, RULE_comment = 4, RULE_file = 0, RULE_lineSeq = 1, RULE_nline = 2, RULE_line = 3, RULE_label = 4,
RULE_instruction = 5, RULE_paramMode = 6, RULE_param = 7; RULE_comment = 5, RULE_instruction = 6, RULE_paramMode = 7, RULE_param = 8;
public static final String[] ruleNames = { public static final String[] ruleNames = {
"file", "lineSeq", "line", "label", "comment", "instruction", "paramMode", "file", "lineSeq", "nline", "line", "label", "comment", "instruction",
"param" "paramMode", "param"
}; };
private static final String[] _LITERAL_NAMES = { private static final String[] _LITERAL_NAMES = {
@ -115,9 +115,9 @@ public class Asm6502Parser extends Parser {
try { try {
enterOuterAlt(_localctx, 1); enterOuterAlt(_localctx, 1);
{ {
setState(16); setState(18);
lineSeq(); lineSeq();
setState(17); setState(19);
match(EOF); match(EOF);
} }
} }
@ -133,11 +133,14 @@ public class Asm6502Parser extends Parser {
} }
public static class LineSeqContext extends ParserRuleContext { public static class LineSeqContext extends ParserRuleContext {
public List<LineContext> line() { public LineContext line() {
return getRuleContexts(LineContext.class); return getRuleContext(LineContext.class,0);
} }
public LineContext line(int i) { public List<NlineContext> nline() {
return getRuleContext(LineContext.class,i); return getRuleContexts(NlineContext.class);
}
public NlineContext nline(int i) {
return getRuleContext(NlineContext.class,i);
} }
public LineSeqContext(ParserRuleContext parent, int invokingState) { public LineSeqContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState); super(parent, invokingState);
@ -165,20 +168,70 @@ public class Asm6502Parser extends Parser {
try { try {
enterOuterAlt(_localctx, 1); enterOuterAlt(_localctx, 1);
{ {
setState(20); setState(21);
line();
{
setState(25);
_errHandler.sync(this); _errHandler.sync(this);
_la = _input.LA(1); _la = _input.LA(1);
do { while (_la==T__0) {
{ {
{ {
setState(19); setState(22);
line(); nline();
} }
} }
setState(22); setState(27);
_errHandler.sync(this); _errHandler.sync(this);
_la = _input.LA(1); _la = _input.LA(1);
} while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__0) | (1L << T__2) | (1L << MNEMONIC) | (1L << NAME))) != 0) ); }
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class NlineContext extends ParserRuleContext {
public LineContext line() {
return getRuleContext(LineContext.class,0);
}
public NlineContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_nline; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof Asm6502Listener ) ((Asm6502Listener)listener).enterNline(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof Asm6502Listener ) ((Asm6502Listener)listener).exitNline(this);
}
@Override
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
if ( visitor instanceof Asm6502Visitor ) return ((Asm6502Visitor<? extends T>)visitor).visitNline(this);
else return visitor.visitChildren(this);
}
}
public final NlineContext nline() throws RecognitionException {
NlineContext _localctx = new NlineContext(_ctx, getState());
enterRule(_localctx, 4, RULE_nline);
try {
enterOuterAlt(_localctx, 1);
{
setState(28);
match(T__0);
setState(29);
line();
} }
} }
catch (RecognitionException re) { catch (RecognitionException re) {
@ -223,43 +276,41 @@ public class Asm6502Parser extends Parser {
public final LineContext line() throws RecognitionException { public final LineContext line() throws RecognitionException {
LineContext _localctx = new LineContext(_ctx, getState()); LineContext _localctx = new LineContext(_ctx, getState());
enterRule(_localctx, 4, RULE_line); enterRule(_localctx, 6, RULE_line);
int _la; int _la;
try { try {
enterOuterAlt(_localctx, 1); enterOuterAlt(_localctx, 1);
{ {
setState(25); setState(32);
_errHandler.sync(this); _errHandler.sync(this);
_la = _input.LA(1); _la = _input.LA(1);
if (_la==NAME) { if (_la==NAME) {
{ {
setState(24); setState(31);
label(); label();
} }
} }
setState(28); setState(35);
_errHandler.sync(this); _errHandler.sync(this);
_la = _input.LA(1); _la = _input.LA(1);
if (_la==MNEMONIC) { if (_la==MNEMONIC) {
{ {
setState(27); setState(34);
instruction(); instruction();
} }
} }
setState(31); setState(38);
_errHandler.sync(this); _errHandler.sync(this);
_la = _input.LA(1); _la = _input.LA(1);
if (_la==T__2) { if (_la==T__2) {
{ {
setState(30); setState(37);
comment(); comment();
} }
} }
setState(33);
match(T__0);
} }
} }
catch (RecognitionException re) { catch (RecognitionException re) {
@ -296,13 +347,13 @@ public class Asm6502Parser extends Parser {
public final LabelContext label() throws RecognitionException { public final LabelContext label() throws RecognitionException {
LabelContext _localctx = new LabelContext(_ctx, getState()); LabelContext _localctx = new LabelContext(_ctx, getState());
enterRule(_localctx, 6, RULE_label); enterRule(_localctx, 8, RULE_label);
try { try {
enterOuterAlt(_localctx, 1); enterOuterAlt(_localctx, 1);
{ {
setState(35); setState(40);
match(NAME); match(NAME);
setState(36); setState(41);
match(T__1); match(T__1);
} }
} }
@ -339,26 +390,26 @@ public class Asm6502Parser extends Parser {
public final CommentContext comment() throws RecognitionException { public final CommentContext comment() throws RecognitionException {
CommentContext _localctx = new CommentContext(_ctx, getState()); CommentContext _localctx = new CommentContext(_ctx, getState());
enterRule(_localctx, 8, RULE_comment); enterRule(_localctx, 10, RULE_comment);
try { try {
int _alt; int _alt;
enterOuterAlt(_localctx, 1); enterOuterAlt(_localctx, 1);
{ {
setState(38); setState(43);
match(T__2); match(T__2);
setState(42); setState(47);
_errHandler.sync(this); _errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,4,_ctx); _alt = getInterpreter().adaptivePredict(_input,4,_ctx);
while ( _alt!=1 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { while ( _alt!=1 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1+1 ) { if ( _alt==1+1 ) {
{ {
{ {
setState(39); setState(44);
matchWildcard(); matchWildcard();
} }
} }
} }
setState(44); setState(49);
_errHandler.sync(this); _errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,4,_ctx); _alt = getInterpreter().adaptivePredict(_input,4,_ctx);
} }
@ -401,19 +452,19 @@ public class Asm6502Parser extends Parser {
public final InstructionContext instruction() throws RecognitionException { public final InstructionContext instruction() throws RecognitionException {
InstructionContext _localctx = new InstructionContext(_ctx, getState()); InstructionContext _localctx = new InstructionContext(_ctx, getState());
enterRule(_localctx, 10, RULE_instruction); enterRule(_localctx, 12, RULE_instruction);
int _la; int _la;
try { try {
enterOuterAlt(_localctx, 1); enterOuterAlt(_localctx, 1);
{ {
setState(45); setState(50);
match(MNEMONIC); match(MNEMONIC);
setState(47); setState(52);
_errHandler.sync(this); _errHandler.sync(this);
_la = _input.LA(1); _la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__3) | (1L << T__6) | (1L << T__8) | (1L << NUMINT) | (1L << NAME))) != 0)) { if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__3) | (1L << T__6) | (1L << T__8) | (1L << NUMINT) | (1L << NAME))) != 0)) {
{ {
setState(46); setState(51);
paramMode(); paramMode();
} }
} }
@ -578,16 +629,16 @@ public class Asm6502Parser extends Parser {
public final ParamModeContext paramMode() throws RecognitionException { public final ParamModeContext paramMode() throws RecognitionException {
ParamModeContext _localctx = new ParamModeContext(_ctx, getState()); ParamModeContext _localctx = new ParamModeContext(_ctx, getState());
enterRule(_localctx, 12, RULE_paramMode); enterRule(_localctx, 14, RULE_paramMode);
try { try {
setState(72); setState(77);
_errHandler.sync(this); _errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,6,_ctx) ) { switch ( getInterpreter().adaptivePredict(_input,6,_ctx) ) {
case 1: case 1:
_localctx = new ModeAbsContext(_localctx); _localctx = new ModeAbsContext(_localctx);
enterOuterAlt(_localctx, 1); enterOuterAlt(_localctx, 1);
{ {
setState(49); setState(54);
param(); param();
} }
break; break;
@ -595,9 +646,9 @@ public class Asm6502Parser extends Parser {
_localctx = new ModeImmContext(_localctx); _localctx = new ModeImmContext(_localctx);
enterOuterAlt(_localctx, 2); enterOuterAlt(_localctx, 2);
{ {
setState(50); setState(55);
match(T__3); match(T__3);
setState(51); setState(56);
param(); param();
} }
break; break;
@ -605,9 +656,9 @@ public class Asm6502Parser extends Parser {
_localctx = new ModeAbsXContext(_localctx); _localctx = new ModeAbsXContext(_localctx);
enterOuterAlt(_localctx, 3); enterOuterAlt(_localctx, 3);
{ {
setState(52); setState(57);
param(); param();
setState(53); setState(58);
match(T__4); match(T__4);
} }
break; break;
@ -615,9 +666,9 @@ public class Asm6502Parser extends Parser {
_localctx = new ModeAbsYContext(_localctx); _localctx = new ModeAbsYContext(_localctx);
enterOuterAlt(_localctx, 4); enterOuterAlt(_localctx, 4);
{ {
setState(55); setState(60);
param(); param();
setState(56); setState(61);
match(T__5); match(T__5);
} }
break; break;
@ -625,13 +676,13 @@ public class Asm6502Parser extends Parser {
_localctx = new ModeIndYContext(_localctx); _localctx = new ModeIndYContext(_localctx);
enterOuterAlt(_localctx, 5); enterOuterAlt(_localctx, 5);
{ {
setState(58); setState(63);
match(T__6); match(T__6);
setState(59); setState(64);
param(); param();
setState(60); setState(65);
match(T__7); match(T__7);
setState(61); setState(66);
match(T__5); match(T__5);
} }
break; break;
@ -639,13 +690,13 @@ public class Asm6502Parser extends Parser {
_localctx = new ModeIndXContext(_localctx); _localctx = new ModeIndXContext(_localctx);
enterOuterAlt(_localctx, 6); enterOuterAlt(_localctx, 6);
{ {
setState(63); setState(68);
match(T__6); match(T__6);
setState(64); setState(69);
param(); param();
setState(65); setState(70);
match(T__4); match(T__4);
setState(66); setState(71);
match(T__7); match(T__7);
} }
break; break;
@ -653,11 +704,11 @@ public class Asm6502Parser extends Parser {
_localctx = new ModeIndContext(_localctx); _localctx = new ModeIndContext(_localctx);
enterOuterAlt(_localctx, 7); enterOuterAlt(_localctx, 7);
{ {
setState(68); setState(73);
match(T__6); match(T__6);
setState(69); setState(74);
param(); param();
setState(70); setState(75);
match(T__7); match(T__7);
} }
break; break;
@ -739,16 +790,16 @@ public class Asm6502Parser extends Parser {
public final ParamContext param() throws RecognitionException { public final ParamContext param() throws RecognitionException {
ParamContext _localctx = new ParamContext(_ctx, getState()); ParamContext _localctx = new ParamContext(_ctx, getState());
enterRule(_localctx, 14, RULE_param); enterRule(_localctx, 16, RULE_param);
try { try {
setState(79); setState(84);
_errHandler.sync(this); _errHandler.sync(this);
switch (_input.LA(1)) { switch (_input.LA(1)) {
case NAME: case NAME:
_localctx = new ParamLabelContext(_localctx); _localctx = new ParamLabelContext(_localctx);
enterOuterAlt(_localctx, 1); enterOuterAlt(_localctx, 1);
{ {
setState(74); setState(79);
match(NAME); match(NAME);
} }
break; break;
@ -756,11 +807,11 @@ public class Asm6502Parser extends Parser {
_localctx = new ParamReplaceContext(_localctx); _localctx = new ParamReplaceContext(_localctx);
enterOuterAlt(_localctx, 2); enterOuterAlt(_localctx, 2);
{ {
setState(75); setState(80);
match(T__8); match(T__8);
setState(76); setState(81);
match(NAME); match(NAME);
setState(77); setState(82);
match(T__9); match(T__9);
} }
break; break;
@ -768,7 +819,7 @@ public class Asm6502Parser extends Parser {
_localctx = new ParamIntContext(_localctx); _localctx = new ParamIntContext(_localctx);
enterOuterAlt(_localctx, 3); enterOuterAlt(_localctx, 3);
{ {
setState(78); setState(83);
match(NUMINT); match(NUMINT);
} }
break; break;
@ -788,28 +839,29 @@ public class Asm6502Parser extends Parser {
} }
public static final String _serializedATN = public static final String _ser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\64\66\7\r\2\2\65"+
"\2\65K\5\20\t\2\66\67\5\20\t\2\678\7\7\2\28K\3\2\2\29:\5\20\t\2:;\7\b"+ "\67\5\20\t\2\66\65\3\2\2\2\66\67\3\2\2\2\67\17\3\2\2\28P\5\22\n\29:\7"+
"\2\2;K\3\2\2\2<=\7\t\2\2=>\5\20\t\2>?\7\n\2\2?@\7\b\2\2@K\3\2\2\2AB\7"+ "\6\2\2:P\5\22\n\2;<\5\22\n\2<=\7\7\2\2=P\3\2\2\2>?\5\22\n\2?@\7\b\2\2"+
"\t\2\2BC\5\20\t\2CD\7\7\2\2DE\7\n\2\2EK\3\2\2\2FG\7\t\2\2GH\5\20\t\2H"+ "@P\3\2\2\2AB\7\t\2\2BC\5\22\n\2CD\7\n\2\2DE\7\b\2\2EP\3\2\2\2FG\7\t\2"+
"I\7\n\2\2IK\3\2\2\2J\63\3\2\2\2J\64\3\2\2\2J\66\3\2\2\2J9\3\2\2\2J<\3"+ "\2GH\5\22\n\2HI\7\7\2\2IJ\7\n\2\2JP\3\2\2\2KL\7\t\2\2LM\5\22\n\2MN\7\n"+
"\2\2\2JA\3\2\2\2JF\3\2\2\2K\17\3\2\2\2LR\7\22\2\2MN\7\13\2\2NO\7\22\2"+ "\2\2NP\3\2\2\2O8\3\2\2\2O9\3\2\2\2O;\3\2\2\2O>\3\2\2\2OA\3\2\2\2OF\3\2"+
"\2OR\7\f\2\2PR\7\16\2\2QL\3\2\2\2QM\3\2\2\2QP\3\2\2\2R\21\3\2\2\2\n\30"+ "\2\2OK\3\2\2\2P\21\3\2\2\2QW\7\22\2\2RS\7\13\2\2ST\7\22\2\2TW\7\f\2\2"+
"\33\36!,\61JQ"; "UW\7\16\2\2VQ\3\2\2\2VR\3\2\2\2VU\3\2\2\2W\23\3\2\2\2\n\33\"%(\61\66O"+
"V";
public static final ATN _ATN = public static final ATN _ATN =
new ATNDeserializer().deserialize(_serializedATN.toCharArray()); new ATNDeserializer().deserialize(_serializedATN.toCharArray());
static { static {

View File

@ -22,6 +22,12 @@ public interface Asm6502Visitor<T> extends ParseTreeVisitor<T> {
* @return the visitor result * @return the visitor result
*/ */
T visitLineSeq(Asm6502Parser.LineSeqContext ctx); T visitLineSeq(Asm6502Parser.LineSeqContext ctx);
/**
* Visit a parse tree produced by {@link Asm6502Parser#nline}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitNline(Asm6502Parser.NlineContext ctx);
/** /**
* Visit a parse tree produced by {@link Asm6502Parser#line}. * Visit a parse tree produced by {@link Asm6502Parser#line}.
* @param ctx the parse tree * @param ctx the parse tree

View File

@ -22,10 +22,10 @@ public class Pass3RegisterAllocation {
allocation.allocate(var, new RegisterAllocation.RegisterZpBool(currentZp++)); allocation.allocate(var, new RegisterAllocation.RegisterZpBool(currentZp++));
} }
} }
// allocation.allocate(symbols.getVariable("i#1"), RegisterAllocation.getRegisterX()); allocation.allocate(symbols.getVariable("i#1"), RegisterAllocation.getRegisterX());
// allocation.allocate(symbols.getVariable("i#3"), RegisterAllocation.getRegisterX()); allocation.allocate(symbols.getVariable("i#3"), RegisterAllocation.getRegisterX());
// allocation.allocate(symbols.getVariable("n1#1"), new RegisterAllocation.RegisterZpByte(8)); allocation.allocate(symbols.getVariable("n1#1"), new RegisterAllocation.RegisterZpByte(8));
// allocation.allocate(symbols.getVariable("n1#2"), new RegisterAllocation.RegisterZpByte(8)); allocation.allocate(symbols.getVariable("n1#2"), new RegisterAllocation.RegisterZpByte(8));
symbols.setAllocation(allocation); symbols.setAllocation(allocation);
} }