use of antlr.Token in project jasn1 by openmuc.
the class ASNLexer method mBAR.
public final void mBAR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype;
Token _token = null;
int _begin = text.length();
_ttype = BAR;
int _saveIndex;
match('|');
if (_createToken && _token == null && _ttype != Token.SKIP) {
_token = makeToken(_ttype);
_token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
}
_returnToken = _token;
}
use of antlr.Token in project jasn1 by openmuc.
the class ASNLexer method mR_BRACKET.
public final void mR_BRACKET(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype;
Token _token = null;
int _begin = text.length();
_ttype = R_BRACKET;
int _saveIndex;
match(']');
if (_createToken && _token == null && _ttype != Token.SKIP) {
_token = makeToken(_ttype);
_token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
}
_returnToken = _token;
}
use of antlr.Token in project jasn1 by openmuc.
the class ASNLexer method mUPPER.
public final void mUPPER(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype;
Token _token = null;
int _begin = text.length();
_ttype = UPPER;
int _saveIndex;
{
matchRange('A', 'Z');
}
{
_loop51: do {
if ((_tokenSet_5.member(LA(1)))) {
{
switch(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':
{
matchRange('a', 'z');
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':
{
matchRange('A', 'Z');
break;
}
case '-':
{
match('-');
break;
}
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
{
matchRange('0', '9');
break;
}
case '_':
{
match('_');
break;
}
default:
{
throw new NoViableAltForCharException((char) LA(1), getFilename(), getLine(), getColumn());
}
}
}
} else {
break _loop51;
}
} while (true);
}
if (_createToken && _token == null && _ttype != Token.SKIP) {
_token = makeToken(_ttype);
_token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
}
_returnToken = _token;
}
use of antlr.Token in project jasn1 by openmuc.
the class ASNLexer method mCOMMA.
public final void mCOMMA(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype;
Token _token = null;
int _begin = text.length();
_ttype = COMMA;
int _saveIndex;
match(',');
if (_createToken && _token == null && _ttype != Token.SKIP) {
_token = makeToken(_ttype);
_token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
}
_returnToken = _token;
}
use of antlr.Token in project jasn1 by openmuc.
the class ASNLexer method mB_STRING.
protected final void mB_STRING(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype;
Token _token = null;
int _begin = text.length();
_ttype = B_STRING;
int _saveIndex;
mSINGLE_QUOTE(false);
{
int _cnt70 = 0;
_loop70: do {
if ((LA(1) == '0' || LA(1) == '1')) {
mBDIG(false);
} else {
if (_cnt70 >= 1) {
break _loop70;
} else {
throw new NoViableAltForCharException((char) LA(1), getFilename(), getLine(), getColumn());
}
}
_cnt70++;
} while (true);
}
mSINGLE_QUOTE(false);
match('B');
if (_createToken && _token == null && _ttype != Token.SKIP) {
_token = makeToken(_ttype);
_token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
}
_returnToken = _token;
}
Aggregations