1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-09-08 17:54:40 +00:00

Made ASM parenthesis hard.

This commit is contained in:
jespergravgaard 2018-01-28 23:22:22 +01:00
parent 341d8c5556
commit 02d7170a4c
3 changed files with 19 additions and 19 deletions

View File

@ -275,7 +275,7 @@ public class AsmFragmentInstance {
@Override
public Object visitAsmExprPar(KickCParser.AsmExprParContext ctx) {
AsmParameter sub = (AsmParameter) this.visit(ctx.asmExpr());
String param = "(" + sub.getParam() + ")";
String param = "[" + sub.getParam() + "]";
return new AsmParameter(param, sub.isZp());
}

View File

@ -142,7 +142,7 @@ asmParamMode
;
asmExpr
: '(' asmExpr ')' #asmExprPar
: '[' asmExpr ']' #asmExprPar
| asmExpr ( '<<' | '>>' ) asmExpr #asmExprBinary
| ('+' | '-' | '<' | '>' ) asmExpr #asmExprUnary
| asmExpr ('*' | '/' ) asmExpr #asmExprBinary

View File

@ -3213,18 +3213,18 @@ public class KickCParser extends Parser {
setState(382);
_errHandler.sync(this);
switch (_input.LA(1)) {
case T__1:
case T__21:
{
_localctx = new AsmExprParContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(369);
match(T__1);
match(T__21);
setState(370);
asmExpr(0);
setState(371);
match(T__2);
match(T__22);
}
break;
case T__25:
@ -3592,20 +3592,20 @@ public class KickCParser extends Parser {
"\u016b\u0171\3\2\2\2\u016c\u016d\7\4\2\2\u016d\u016e\5\62\32\2\u016e\u016f"+
"\7\5\2\2\u016f\u0171\3\2\2\2\u0170\u0159\3\2\2\2\u0170\u015a\3\2\2\2\u0170"+
"\u015c\3\2\2\2\u0170\u0160\3\2\2\2\u0170\u0166\3\2\2\2\u0170\u016c\3\2"+
"\2\2\u0171\61\3\2\2\2\u0172\u0173\b\32\1\2\u0173\u0174\7\4\2\2\u0174\u0175"+
"\5\62\32\2\u0175\u0176\7\5\2\2\u0176\u0181\3\2\2\2\u0177\u0178\t\t\2\2"+
"\u0178\u0181\5\62\32\n\u0179\u0181\7B\2\2\u017a\u0181\7C\2\2\u017b\u017c"+
"\7\6\2\2\u017c\u017d\7B\2\2\u017d\u0181\7\7\2\2\u017e\u0181\79\2\2\u017f"+
"\u0181\7\67\2\2\u0180\u0172\3\2\2\2\u0180\u0177\3\2\2\2\u0180\u0179\3"+
"\2\2\2\u0180\u017a\3\2\2\2\u0180\u017b\3\2\2\2\u0180\u017e\3\2\2\2\u0180"+
"\u017f\3\2\2\2\u0181\u018d\3\2\2\2\u0182\u0183\f\13\2\2\u0183\u0184\t"+
"\5\2\2\u0184\u018c\5\62\32\f\u0185\u0186\f\t\2\2\u0186\u0187\t\n\2\2\u0187"+
"\u018c\5\62\32\n\u0188\u0189\f\b\2\2\u0189\u018a\t\7\2\2\u018a\u018c\5"+
"\62\32\t\u018b\u0182\3\2\2\2\u018b\u0185\3\2\2\2\u018b\u0188\3\2\2\2\u018c"+
"\u018f\3\2\2\2\u018d\u018b\3\2\2\2\u018d\u018e\3\2\2\2\u018e\63\3\2\2"+
"\2\u018f\u018d\3\2\2\2)>GMRW^einu|\u0081\u0086\u0093\u00a6\u00ae\u00b6"+
"\u00b9\u00be\u00ca\u00d0\u00d7\u00da\u00dc\u00e7\u00fd\u0107\u012e\u0130"+
"\u0138\u013e\u0144\u014a\u014e\u0156\u0170\u0180\u018b\u018d";
"\2\2\u0171\61\3\2\2\2\u0172\u0173\b\32\1\2\u0173\u0174\7\30\2\2\u0174"+
"\u0175\5\62\32\2\u0175\u0176\7\31\2\2\u0176\u0181\3\2\2\2\u0177\u0178"+
"\t\t\2\2\u0178\u0181\5\62\32\n\u0179\u0181\7B\2\2\u017a\u0181\7C\2\2\u017b"+
"\u017c\7\6\2\2\u017c\u017d\7B\2\2\u017d\u0181\7\7\2\2\u017e\u0181\79\2"+
"\2\u017f\u0181\7\67\2\2\u0180\u0172\3\2\2\2\u0180\u0177\3\2\2\2\u0180"+
"\u0179\3\2\2\2\u0180\u017a\3\2\2\2\u0180\u017b\3\2\2\2\u0180\u017e\3\2"+
"\2\2\u0180\u017f\3\2\2\2\u0181\u018d\3\2\2\2\u0182\u0183\f\13\2\2\u0183"+
"\u0184\t\5\2\2\u0184\u018c\5\62\32\f\u0185\u0186\f\t\2\2\u0186\u0187\t"+
"\n\2\2\u0187\u018c\5\62\32\n\u0188\u0189\f\b\2\2\u0189\u018a\t\7\2\2\u018a"+
"\u018c\5\62\32\t\u018b\u0182\3\2\2\2\u018b\u0185\3\2\2\2\u018b\u0188\3"+
"\2\2\2\u018c\u018f\3\2\2\2\u018d\u018b\3\2\2\2\u018d\u018e\3\2\2\2\u018e"+
"\63\3\2\2\2\u018f\u018d\3\2\2\2)>GMRW^einu|\u0081\u0086\u0093\u00a6\u00ae"+
"\u00b6\u00b9\u00be\u00ca\u00d0\u00d7\u00da\u00dc\u00e7\u00fd\u0107\u012e"+
"\u0130\u0138\u013e\u0144\u014a\u014e\u0156\u0170\u0180\u018b\u018d";
public static final ATN _ATN =
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
static {