Files
dhbw-compilerbau/CC-Praxis-Antlr Parser fuer X-Leer/XLexer.java

1326 lines
37 KiB
Java

// $ANTLR 3.5.2 C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g 2020-06-03 13:09:27
package de.dhbw.compiler.antlrxparser;
import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;
@SuppressWarnings("all")
public class XLexer extends Lexer {
public static final int EOF=-1;
public static final int T__23=23;
public static final int T__24=24;
public static final int T__25=25;
public static final int T__26=26;
public static final int T__27=27;
public static final int T__28=28;
public static final int T__29=29;
public static final int T__30=30;
public static final int T__31=31;
public static final int T__32=32;
public static final int T__33=33;
public static final int T__34=34;
public static final int T__35=35;
public static final int T__36=36;
public static final int T__37=37;
public static final int T__38=38;
public static final int T__39=39;
public static final int T__40=40;
public static final int T__41=41;
public static final int T__42=42;
public static final int BINOP=4;
public static final int DECL=5;
public static final int DECLIST=6;
public static final int ESCAPE=7;
public static final int EXPR=8;
public static final int FLOATCONST=9;
public static final int ID=10;
public static final int INTCONST=11;
public static final int MODIFIER=12;
public static final int PROGRAM=13;
public static final int STAT=14;
public static final int STATLIST=15;
public static final int STRINGCONST=16;
public static final int TYPE=17;
public static final int UDIVIDE=18;
public static final int UMINUS=19;
public static final int UMULTIPLY=20;
public static final int UPLUS=21;
public static final int WS=22;
// delegates
// delegators
public Lexer[] getDelegates() {
return new Lexer[] {};
}
public XLexer() {}
public XLexer(CharStream input) {
this(input, new RecognizerSharedState());
}
public XLexer(CharStream input, RecognizerSharedState state) {
super(input,state);
}
@Override public String getGrammarFileName() { return "C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g"; }
// $ANTLR start "UDIVIDE"
public final void mUDIVIDE() throws RecognitionException {
try {
int _type = UDIVIDE;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:9:9: ( '/' )
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:9:11: '/'
{
match('/');
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "UDIVIDE"
// $ANTLR start "UMINUS"
public final void mUMINUS() throws RecognitionException {
try {
int _type = UMINUS;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:10:8: ( '-' )
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:10:10: '-'
{
match('-');
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "UMINUS"
// $ANTLR start "UMULTIPLY"
public final void mUMULTIPLY() throws RecognitionException {
try {
int _type = UMULTIPLY;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:11:11: ( '*' )
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:11:13: '*'
{
match('*');
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "UMULTIPLY"
// $ANTLR start "UPLUS"
public final void mUPLUS() throws RecognitionException {
try {
int _type = UPLUS;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:12:7: ( '+' )
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:12:9: '+'
{
match('+');
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "UPLUS"
// $ANTLR start "T__23"
public final void mT__23() throws RecognitionException {
try {
int _type = T__23;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:13:7: ( '(' )
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:13:9: '('
{
match('(');
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "T__23"
// $ANTLR start "T__24"
public final void mT__24() throws RecognitionException {
try {
int _type = T__24;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:14:7: ( ')' )
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:14:9: ')'
{
match(')');
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "T__24"
// $ANTLR start "T__25"
public final void mT__25() throws RecognitionException {
try {
int _type = T__25;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:15:7: ( '.' )
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:15:9: '.'
{
match('.');
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "T__25"
// $ANTLR start "T__26"
public final void mT__26() throws RecognitionException {
try {
int _type = T__26;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:16:7: ( ':' )
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:16:9: ':'
{
match(':');
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "T__26"
// $ANTLR start "T__27"
public final void mT__27() throws RecognitionException {
try {
int _type = T__27;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:17:7: ( ':=' )
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:17:9: ':='
{
match(":=");
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "T__27"
// $ANTLR start "T__28"
public final void mT__28() throws RecognitionException {
try {
int _type = T__28;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:18:7: ( ';' )
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:18:9: ';'
{
match(';');
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "T__28"
// $ANTLR start "T__29"
public final void mT__29() throws RecognitionException {
try {
int _type = T__29;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:19:7: ( 'begin' )
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:19:9: 'begin'
{
match("begin");
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "T__29"
// $ANTLR start "T__30"
public final void mT__30() throws RecognitionException {
try {
int _type = T__30;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:20:7: ( 'else' )
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:20:9: 'else'
{
match("else");
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "T__30"
// $ANTLR start "T__31"
public final void mT__31() throws RecognitionException {
try {
int _type = T__31;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:21:7: ( 'end' )
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:21:9: 'end'
{
match("end");
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "T__31"
// $ANTLR start "T__32"
public final void mT__32() throws RecognitionException {
try {
int _type = T__32;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:22:7: ( 'float' )
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:22:9: 'float'
{
match("float");
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "T__32"
// $ANTLR start "T__33"
public final void mT__33() throws RecognitionException {
try {
int _type = T__33;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:23:7: ( 'for' )
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:23:9: 'for'
{
match("for");
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "T__33"
// $ANTLR start "T__34"
public final void mT__34() throws RecognitionException {
try {
int _type = T__34;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:24:7: ( 'if' )
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:24:9: 'if'
{
match("if");
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "T__34"
// $ANTLR start "T__35"
public final void mT__35() throws RecognitionException {
try {
int _type = T__35;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:25:7: ( 'int' )
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:25:9: 'int'
{
match("int");
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "T__35"
// $ANTLR start "T__36"
public final void mT__36() throws RecognitionException {
try {
int _type = T__36;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:26:7: ( 'print' )
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:26:9: 'print'
{
match("print");
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "T__36"
// $ANTLR start "T__37"
public final void mT__37() throws RecognitionException {
try {
int _type = T__37;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:27:7: ( 'program' )
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:27:9: 'program'
{
match("program");
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "T__37"
// $ANTLR start "T__38"
public final void mT__38() throws RecognitionException {
try {
int _type = T__38;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:28:7: ( 'read print' )
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:28:9: 'read print'
{
match("read print");
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "T__38"
// $ANTLR start "T__39"
public final void mT__39() throws RecognitionException {
try {
int _type = T__39;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:29:7: ( 'read' )
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:29:9: 'read'
{
match("read");
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "T__39"
// $ANTLR start "T__40"
public final void mT__40() throws RecognitionException {
try {
int _type = T__40;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:30:7: ( 'string' )
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:30:9: 'string'
{
match("string");
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "T__40"
// $ANTLR start "T__41"
public final void mT__41() throws RecognitionException {
try {
int _type = T__41;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:31:7: ( 'then' )
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:31:9: 'then'
{
match("then");
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "T__41"
// $ANTLR start "T__42"
public final void mT__42() throws RecognitionException {
try {
int _type = T__42;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:32:7: ( 'while' )
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:32:9: 'while'
{
match("while");
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "T__42"
// $ANTLR start "ID"
public final void mID() throws RecognitionException {
try {
int _type = ID;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:46:3: ( ( 'a' .. 'z' | 'A' .. 'Z' ) ( options {greedy=true; } : 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' )* )
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:46:13: ( 'a' .. 'z' | 'A' .. 'Z' ) ( options {greedy=true; } : 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' )*
{
if ( (input.LA(1) >= 'A' && input.LA(1) <= 'Z')||(input.LA(1) >= 'a' && input.LA(1) <= 'z') ) {
input.consume();
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
recover(mse);
throw mse;
}
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:47:13: ( options {greedy=true; } : 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' )*
loop1:
while (true) {
int alt1=4;
switch ( input.LA(1) ) {
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
{
alt1=1;
}
break;
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
{
alt1=2;
}
break;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
{
alt1=3;
}
break;
}
switch (alt1) {
case 1 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:49:16: 'a' .. 'z'
{
matchRange('a','z');
}
break;
case 2 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:49:27: 'A' .. 'Z'
{
matchRange('A','Z');
}
break;
case 3 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:49:38: '0' .. '9'
{
matchRange('0','9');
}
break;
default :
break loop1;
}
}
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "ID"
// $ANTLR start "INTCONST"
public final void mINTCONST() throws RecognitionException {
try {
int _type = INTCONST;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:51:9: ( ( '0' .. '9' )+ )
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:51:17: ( '0' .. '9' )+
{
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:51:17: ( '0' .. '9' )+
int cnt2=0;
loop2:
while (true) {
int alt2=2;
int LA2_0 = input.LA(1);
if ( ((LA2_0 >= '0' && LA2_0 <= '9')) ) {
alt2=1;
}
switch (alt2) {
case 1 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:
{
if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
input.consume();
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
recover(mse);
throw mse;
}
}
break;
default :
if ( cnt2 >= 1 ) break loop2;
EarlyExitException eee = new EarlyExitException(2, input);
throw eee;
}
cnt2++;
}
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "INTCONST"
// $ANTLR start "FLOATCONST"
public final void mFLOATCONST() throws RecognitionException {
try {
int _type = FLOATCONST;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:52:11: ( INTCONST '.' INTCONST )
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:52:17: INTCONST '.' INTCONST
{
mINTCONST();
match('.');
mINTCONST();
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "FLOATCONST"
// $ANTLR start "STRINGCONST"
public final void mSTRINGCONST() throws RecognitionException {
try {
int _type = STRINGCONST;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:54:12: ( '\"' ( ESCAPE |~ ( '\\\\' | '\"' ) )* '\"' )
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:54:17: '\"' ( ESCAPE |~ ( '\\\\' | '\"' ) )* '\"'
{
match('\"');
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:54:21: ( ESCAPE |~ ( '\\\\' | '\"' ) )*
loop3:
while (true) {
int alt3=3;
int LA3_0 = input.LA(1);
if ( (LA3_0=='\\') ) {
alt3=1;
}
else if ( ((LA3_0 >= '\u0000' && LA3_0 <= '!')||(LA3_0 >= '#' && LA3_0 <= '[')||(LA3_0 >= ']' && LA3_0 <= '\uFFFF')) ) {
alt3=2;
}
switch (alt3) {
case 1 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:54:22: ESCAPE
{
mESCAPE();
}
break;
case 2 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:54:31: ~ ( '\\\\' | '\"' )
{
if ( (input.LA(1) >= '\u0000' && input.LA(1) <= '!')||(input.LA(1) >= '#' && input.LA(1) <= '[')||(input.LA(1) >= ']' && input.LA(1) <= '\uFFFF') ) {
input.consume();
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
recover(mse);
throw mse;
}
}
break;
default :
break loop3;
}
}
match('\"');
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "STRINGCONST"
// $ANTLR start "ESCAPE"
public final void mESCAPE() throws RecognitionException {
try {
int _type = ESCAPE;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:55:7: ( '\\\\' ( '\\\"' | '\\'' | '\\\\' ) )
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:55:17: '\\\\' ( '\\\"' | '\\'' | '\\\\' )
{
match('\\');
if ( input.LA(1)=='\"'||input.LA(1)=='\''||input.LA(1)=='\\' ) {
input.consume();
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
recover(mse);
throw mse;
}
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "ESCAPE"
// $ANTLR start "BINOP"
public final void mBINOP() throws RecognitionException {
try {
int _type = BINOP;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:57:6: ( '+' | '-' | '*' | '/' | '<' | '>' | '=' )
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:
{
if ( (input.LA(1) >= '*' && input.LA(1) <= '+')||input.LA(1)=='-'||input.LA(1)=='/'||(input.LA(1) >= '<' && input.LA(1) <= '>') ) {
input.consume();
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
recover(mse);
throw mse;
}
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "BINOP"
// $ANTLR start "WS"
public final void mWS() throws RecognitionException {
try {
int _type = WS;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:59:3: ( ( '\\t' | ' ' | '\\r' | '\\n' | '\\f' )+ )
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:59:13: ( '\\t' | ' ' | '\\r' | '\\n' | '\\f' )+
{
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:59:13: ( '\\t' | ' ' | '\\r' | '\\n' | '\\f' )+
int cnt4=0;
loop4:
while (true) {
int alt4=2;
int LA4_0 = input.LA(1);
if ( ((LA4_0 >= '\t' && LA4_0 <= '\n')||(LA4_0 >= '\f' && LA4_0 <= '\r')||LA4_0==' ') ) {
alt4=1;
}
switch (alt4) {
case 1 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:
{
if ( (input.LA(1) >= '\t' && input.LA(1) <= '\n')||(input.LA(1) >= '\f' && input.LA(1) <= '\r')||input.LA(1)==' ' ) {
input.consume();
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
recover(mse);
throw mse;
}
}
break;
default :
if ( cnt4 >= 1 ) break loop4;
EarlyExitException eee = new EarlyExitException(4, input);
throw eee;
}
cnt4++;
}
skip();
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "WS"
@Override
public void mTokens() throws RecognitionException {
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:1:8: ( UDIVIDE | UMINUS | UMULTIPLY | UPLUS | 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 | ID | INTCONST | FLOATCONST | STRINGCONST | ESCAPE | BINOP | WS )
int alt5=31;
alt5 = dfa5.predict(input);
switch (alt5) {
case 1 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:1:10: UDIVIDE
{
mUDIVIDE();
}
break;
case 2 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:1:18: UMINUS
{
mUMINUS();
}
break;
case 3 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:1:25: UMULTIPLY
{
mUMULTIPLY();
}
break;
case 4 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:1:35: UPLUS
{
mUPLUS();
}
break;
case 5 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:1:41: T__23
{
mT__23();
}
break;
case 6 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:1:47: T__24
{
mT__24();
}
break;
case 7 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:1:53: T__25
{
mT__25();
}
break;
case 8 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:1:59: T__26
{
mT__26();
}
break;
case 9 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:1:65: T__27
{
mT__27();
}
break;
case 10 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:1:71: T__28
{
mT__28();
}
break;
case 11 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:1:77: T__29
{
mT__29();
}
break;
case 12 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:1:83: T__30
{
mT__30();
}
break;
case 13 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:1:89: T__31
{
mT__31();
}
break;
case 14 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:1:95: T__32
{
mT__32();
}
break;
case 15 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:1:101: T__33
{
mT__33();
}
break;
case 16 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:1:107: T__34
{
mT__34();
}
break;
case 17 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:1:113: T__35
{
mT__35();
}
break;
case 18 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:1:119: T__36
{
mT__36();
}
break;
case 19 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:1:125: T__37
{
mT__37();
}
break;
case 20 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:1:131: T__38
{
mT__38();
}
break;
case 21 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:1:137: T__39
{
mT__39();
}
break;
case 22 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:1:143: T__40
{
mT__40();
}
break;
case 23 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:1:149: T__41
{
mT__41();
}
break;
case 24 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:1:155: T__42
{
mT__42();
}
break;
case 25 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:1:161: ID
{
mID();
}
break;
case 26 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:1:164: INTCONST
{
mINTCONST();
}
break;
case 27 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:1:173: FLOATCONST
{
mFLOATCONST();
}
break;
case 28 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:1:184: STRINGCONST
{
mSTRINGCONST();
}
break;
case 29 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:1:196: ESCAPE
{
mESCAPE();
}
break;
case 30 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:1:203: BINOP
{
mBINOP();
}
break;
case 31 :
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:1:209: WS
{
mWS();
}
break;
}
}
protected DFA5 dfa5 = new DFA5(this);
static final String DFA5_eotS =
"\10\uffff\1\36\1\uffff\11\23\1\uffff\1\53\12\uffff\5\23\1\62\6\23\2\uffff"+
"\2\23\1\74\1\23\1\76\1\uffff\1\77\7\23\1\107\1\uffff\1\23\2\uffff\2\23"+
"\1\114\1\23\1\116\1\23\1\120\1\uffff\1\121\1\122\1\23\2\uffff\1\23\1\uffff"+
"\1\125\3\uffff\1\23\1\127\1\uffff\1\130\2\uffff";
static final String DFA5_eofS =
"\131\uffff";
static final String DFA5_minS =
"\1\11\7\uffff\1\75\1\uffff\1\145\2\154\1\146\1\162\1\145\1\164\2\150\1"+
"\uffff\1\56\12\uffff\1\147\1\163\1\144\1\157\1\162\1\60\1\164\1\151\1"+
"\141\1\162\1\145\1\151\2\uffff\1\151\1\145\1\60\1\141\1\60\1\uffff\1\60"+
"\1\156\1\147\1\144\1\151\1\156\1\154\1\156\1\60\1\uffff\1\164\2\uffff"+
"\1\164\1\162\1\40\1\156\1\60\1\145\1\60\1\uffff\2\60\1\141\2\uffff\1\147"+
"\1\uffff\1\60\3\uffff\1\155\1\60\1\uffff\1\60\2\uffff";
static final String DFA5_maxS =
"\1\172\7\uffff\1\75\1\uffff\1\145\1\156\1\157\1\156\1\162\1\145\1\164"+
"\2\150\1\uffff\1\71\12\uffff\1\147\1\163\1\144\1\157\1\162\1\172\1\164"+
"\1\157\1\141\1\162\1\145\1\151\2\uffff\1\151\1\145\1\172\1\141\1\172\1"+
"\uffff\1\172\1\156\1\147\1\144\1\151\1\156\1\154\1\156\1\172\1\uffff\1"+
"\164\2\uffff\1\164\1\162\1\172\1\156\1\172\1\145\1\172\1\uffff\2\172\1"+
"\141\2\uffff\1\147\1\uffff\1\172\3\uffff\1\155\1\172\1\uffff\1\172\2\uffff";
static final String DFA5_acceptS =
"\1\uffff\1\1\1\2\1\3\1\4\1\5\1\6\1\7\1\uffff\1\12\11\uffff\1\31\1\uffff"+
"\1\34\1\35\1\36\1\37\1\1\1\2\1\3\1\4\1\11\1\10\14\uffff\1\32\1\33\5\uffff"+
"\1\20\11\uffff\1\15\1\uffff\1\17\1\21\7\uffff\1\14\3\uffff\1\24\1\25\1"+
"\uffff\1\27\1\uffff\1\13\1\16\1\22\2\uffff\1\30\1\uffff\1\26\1\23";
static final String DFA5_specialS =
"\131\uffff}>";
static final String[] DFA5_transitionS = {
"\2\30\1\uffff\2\30\22\uffff\1\30\1\uffff\1\25\5\uffff\1\5\1\6\1\3\1\4"+
"\1\uffff\1\2\1\7\1\1\12\24\1\10\1\11\3\27\2\uffff\32\23\1\uffff\1\26"+
"\4\uffff\1\23\1\12\2\23\1\13\1\14\2\23\1\15\6\23\1\16\1\23\1\17\1\20"+
"\1\21\2\23\1\22\3\23",
"",
"",
"",
"",
"",
"",
"",
"\1\35",
"",
"\1\37",
"\1\40\1\uffff\1\41",
"\1\42\2\uffff\1\43",
"\1\44\7\uffff\1\45",
"\1\46",
"\1\47",
"\1\50",
"\1\51",
"\1\52",
"",
"\1\54\1\uffff\12\24",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"\1\55",
"\1\56",
"\1\57",
"\1\60",
"\1\61",
"\12\23\7\uffff\32\23\6\uffff\32\23",
"\1\63",
"\1\64\5\uffff\1\65",
"\1\66",
"\1\67",
"\1\70",
"\1\71",
"",
"",
"\1\72",
"\1\73",
"\12\23\7\uffff\32\23\6\uffff\32\23",
"\1\75",
"\12\23\7\uffff\32\23\6\uffff\32\23",
"",
"\12\23\7\uffff\32\23\6\uffff\32\23",
"\1\100",
"\1\101",
"\1\102",
"\1\103",
"\1\104",
"\1\105",
"\1\106",
"\12\23\7\uffff\32\23\6\uffff\32\23",
"",
"\1\110",
"",
"",
"\1\111",
"\1\112",
"\1\113\17\uffff\12\23\7\uffff\32\23\6\uffff\32\23",
"\1\115",
"\12\23\7\uffff\32\23\6\uffff\32\23",
"\1\117",
"\12\23\7\uffff\32\23\6\uffff\32\23",
"",
"\12\23\7\uffff\32\23\6\uffff\32\23",
"\12\23\7\uffff\32\23\6\uffff\32\23",
"\1\123",
"",
"",
"\1\124",
"",
"\12\23\7\uffff\32\23\6\uffff\32\23",
"",
"",
"",
"\1\126",
"\12\23\7\uffff\32\23\6\uffff\32\23",
"",
"\12\23\7\uffff\32\23\6\uffff\32\23",
"",
""
};
static final short[] DFA5_eot = DFA.unpackEncodedString(DFA5_eotS);
static final short[] DFA5_eof = DFA.unpackEncodedString(DFA5_eofS);
static final char[] DFA5_min = DFA.unpackEncodedStringToUnsignedChars(DFA5_minS);
static final char[] DFA5_max = DFA.unpackEncodedStringToUnsignedChars(DFA5_maxS);
static final short[] DFA5_accept = DFA.unpackEncodedString(DFA5_acceptS);
static final short[] DFA5_special = DFA.unpackEncodedString(DFA5_specialS);
static final short[][] DFA5_transition;
static {
int numStates = DFA5_transitionS.length;
DFA5_transition = new short[numStates][];
for (int i=0; i<numStates; i++) {
DFA5_transition[i] = DFA.unpackEncodedString(DFA5_transitionS[i]);
}
}
protected class DFA5 extends DFA {
public DFA5(BaseRecognizer recognizer) {
this.recognizer = recognizer;
this.decisionNumber = 5;
this.eot = DFA5_eot;
this.eof = DFA5_eof;
this.min = DFA5_min;
this.max = DFA5_max;
this.accept = DFA5_accept;
this.special = DFA5_special;
this.transition = DFA5_transition;
}
@Override
public String getDescription() {
return "1:1: Tokens : ( UDIVIDE | UMINUS | UMULTIPLY | UPLUS | 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 | ID | INTCONST | FLOATCONST | STRINGCONST | ESCAPE | BINOP | WS );";
}
}
}