mirror of
https://gitlab.com/camelot/kickc.git
synced 2025-01-07 07:29:49 +00:00
better javadoc and names.
This commit is contained in:
parent
41fddfd25c
commit
5229b24ae7
@ -6,11 +6,10 @@ tokens { TYPEDEFNAME }
|
||||
@header {
|
||||
}
|
||||
|
||||
@lexer::members {
|
||||
@members {
|
||||
|
||||
/** The C-Parser. Used for importing C-files and communicating with the Parser about typedefs. */
|
||||
CParser cParser;
|
||||
|
||||
/** True of the next string is the name of a C-file to import*/
|
||||
boolean importEnter = false;
|
||||
/** True if the next CURLY starts ASM_MODE */
|
||||
@ -35,7 +34,7 @@ SEMICOLON: ';' ;
|
||||
COLON: ':';
|
||||
COMMA: ',' ;
|
||||
RANGE : '..' ;
|
||||
QUESTION : '?' ;
|
||||
CONDITION : '?' ;
|
||||
DOT : '.' ;
|
||||
ARROW : '->' ;
|
||||
PLUS: '+';
|
||||
@ -128,7 +127,7 @@ fragment BINDIGIT : [0-1];
|
||||
fragment DECDIGIT : [0-9];
|
||||
fragment HEXDIGIT : [0-9a-fA-F];
|
||||
|
||||
//Names
|
||||
// Names
|
||||
NAME : NAME_START NAME_CHAR* {if(cParser.isTypedef(getText())) setType(TYPEDEFNAME); };
|
||||
fragment NAME_START : [a-zA-Z_];
|
||||
fragment NAME_CHAR : [a-zA-Z0-9_];
|
||||
|
@ -20,7 +20,7 @@ public class KickCLexer extends Lexer {
|
||||
new PredictionContextCache();
|
||||
public static final int
|
||||
TYPEDEFNAME=1, CURLY_BEGIN=2, CURLY_END=3, BRACKET_BEGIN=4, BRACKET_END=5,
|
||||
PAR_BEGIN=6, PAR_END=7, SEMICOLON=8, COLON=9, COMMA=10, RANGE=11, QUESTION=12,
|
||||
PAR_BEGIN=6, PAR_END=7, SEMICOLON=8, COLON=9, COMMA=10, RANGE=11, CONDITION=12,
|
||||
DOT=13, ARROW=14, PLUS=15, MINUS=16, ASTERISK=17, DIVIDE=18, MODULO=19,
|
||||
INC=20, DEC=21, AND=22, BIT_NOT=23, BIT_XOR=24, BIT_OR=25, SHIFT_LEFT=26,
|
||||
SHIFT_RIGHT=27, EQUAL=28, NOT_EQUAL=29, LESS_THAN=30, LESS_THAN_EQUAL=31,
|
||||
@ -55,7 +55,7 @@ public class KickCLexer extends Lexer {
|
||||
|
||||
public static final String[] ruleNames = {
|
||||
"CURLY_BEGIN", "CURLY_END", "BRACKET_BEGIN", "BRACKET_END", "PAR_BEGIN",
|
||||
"PAR_END", "SEMICOLON", "COLON", "COMMA", "RANGE", "QUESTION", "DOT",
|
||||
"PAR_END", "SEMICOLON", "COLON", "COMMA", "RANGE", "CONDITION", "DOT",
|
||||
"ARROW", "PLUS", "MINUS", "ASTERISK", "DIVIDE", "MODULO", "INC", "DEC",
|
||||
"AND", "BIT_NOT", "BIT_XOR", "BIT_OR", "SHIFT_LEFT", "SHIFT_RIGHT", "EQUAL",
|
||||
"NOT_EQUAL", "LESS_THAN", "LESS_THAN_EQUAL", "GREATER_THAN_EQUAL", "GREATER_THAN",
|
||||
@ -96,7 +96,7 @@ public class KickCLexer extends Lexer {
|
||||
};
|
||||
private static final String[] _SYMBOLIC_NAMES = {
|
||||
null, "TYPEDEFNAME", "CURLY_BEGIN", "CURLY_END", "BRACKET_BEGIN", "BRACKET_END",
|
||||
"PAR_BEGIN", "PAR_END", "SEMICOLON", "COLON", "COMMA", "RANGE", "QUESTION",
|
||||
"PAR_BEGIN", "PAR_END", "SEMICOLON", "COLON", "COMMA", "RANGE", "CONDITION",
|
||||
"DOT", "ARROW", "PLUS", "MINUS", "ASTERISK", "DIVIDE", "MODULO", "INC",
|
||||
"DEC", "AND", "BIT_NOT", "BIT_XOR", "BIT_OR", "SHIFT_LEFT", "SHIFT_RIGHT",
|
||||
"EQUAL", "NOT_EQUAL", "LESS_THAN", "LESS_THAN_EQUAL", "GREATER_THAN_EQUAL",
|
||||
@ -155,7 +155,6 @@ public class KickCLexer extends Lexer {
|
||||
|
||||
/** The C-Parser. Used for importing C-files and communicating with the Parser about typedefs. */
|
||||
CParser cParser;
|
||||
|
||||
/** True of the next string is the name of a C-file to import*/
|
||||
boolean importEnter = false;
|
||||
/** True if the next CURLY starts ASM_MODE */
|
||||
|
@ -9,7 +9,7 @@ SEMICOLON=8
|
||||
COLON=9
|
||||
COMMA=10
|
||||
RANGE=11
|
||||
QUESTION=12
|
||||
CONDITION=12
|
||||
DOT=13
|
||||
ARROW=14
|
||||
PLUS=15
|
||||
|
@ -7,7 +7,7 @@ options { tokenVocab=KickCLexer; }
|
||||
}
|
||||
|
||||
|
||||
@parser::members {
|
||||
@members {
|
||||
CParser cParser;
|
||||
|
||||
public KickCParser(TokenStream input, CParser cParser) {
|
||||
|
@ -20,7 +20,7 @@ public class KickCParser extends Parser {
|
||||
new PredictionContextCache();
|
||||
public static final int
|
||||
TYPEDEFNAME=1, CURLY_BEGIN=2, CURLY_END=3, BRACKET_BEGIN=4, BRACKET_END=5,
|
||||
PAR_BEGIN=6, PAR_END=7, SEMICOLON=8, COLON=9, COMMA=10, RANGE=11, QUESTION=12,
|
||||
PAR_BEGIN=6, PAR_END=7, SEMICOLON=8, COLON=9, COMMA=10, RANGE=11, CONDITION=12,
|
||||
DOT=13, ARROW=14, PLUS=15, MINUS=16, ASTERISK=17, DIVIDE=18, MODULO=19,
|
||||
INC=20, DEC=21, AND=22, BIT_NOT=23, BIT_XOR=24, BIT_OR=25, SHIFT_LEFT=26,
|
||||
SHIFT_RIGHT=27, EQUAL=28, NOT_EQUAL=29, LESS_THAN=30, LESS_THAN_EQUAL=31,
|
||||
@ -83,7 +83,7 @@ public class KickCParser extends Parser {
|
||||
};
|
||||
private static final String[] _SYMBOLIC_NAMES = {
|
||||
null, "TYPEDEFNAME", "CURLY_BEGIN", "CURLY_END", "BRACKET_BEGIN", "BRACKET_END",
|
||||
"PAR_BEGIN", "PAR_END", "SEMICOLON", "COLON", "COMMA", "RANGE", "QUESTION",
|
||||
"PAR_BEGIN", "PAR_END", "SEMICOLON", "COLON", "COMMA", "RANGE", "CONDITION",
|
||||
"DOT", "ARROW", "PLUS", "MINUS", "ASTERISK", "DIVIDE", "MODULO", "INC",
|
||||
"DEC", "AND", "BIT_NOT", "BIT_XOR", "BIT_OR", "SHIFT_LEFT", "SHIFT_RIGHT",
|
||||
"EQUAL", "NOT_EQUAL", "LESS_THAN", "LESS_THAN_EQUAL", "GREATER_THAN_EQUAL",
|
||||
@ -4741,7 +4741,7 @@ public class KickCParser extends Parser {
|
||||
setState(581);
|
||||
if (!(precpred(_ctx, 9))) throw new FailedPredicateException(this, "precpred(_ctx, 9)");
|
||||
setState(582);
|
||||
match(QUESTION);
|
||||
match(CONDITION);
|
||||
setState(583);
|
||||
expr(0);
|
||||
setState(584);
|
||||
|
@ -9,7 +9,7 @@ SEMICOLON=8
|
||||
COLON=9
|
||||
COMMA=10
|
||||
RANGE=11
|
||||
QUESTION=12
|
||||
CONDITION=12
|
||||
DOT=13
|
||||
ARROW=14
|
||||
PLUS=15
|
||||
|
Loading…
Reference in New Issue
Block a user