coins.cfront
Class Lex
java.lang.Object
coins.cfront.Lex
- All Implemented Interfaces:
- TokenId, TypeId
- Direct Known Subclasses:
- GccLex
- public class Lex
- extends java.lang.Object
- implements TokenId, TypeId
Lexical analyzer.
| Fields inherited from interface coins.ast.TokenId |
AND_E, ANDAND, ARROW, ASM, AUTO, BAD_TOKEN, BREAK, CASE, CAST_OP, CHAR, CHAR_CONST, COND_OP, CONST, CONTINUE, DEFAULT, DIV_E, DO, DOUBLE, DOUBLE_CONST, ELLIPSIS, ELSE, ENUM, EOF, EQ, EXOR_E, EXTERN, FLOAT, FLOAT_CONST, FOR, FUNCALL, GE, GOTO, IDENTIFIER, IF, IGNORE, INDEX_OP, INLINE, INT, INT_CONST, LE, LONG, LONG_CONST, LONG_DOUBLE_CONST, LONGLONG_CONST, LSHIFT, LSHIFT_E, MINUS_E, MINUSMINUS, MOD_E, MUL_E, MUTABLE, NEQ, OR_E, OROR, PLUS_E, PLUSPLUS, PRAGMA, REGISTER, RESTRICT, RETURN, RSHIFT, RSHIFT_E, SHORT, SIGNED, SIZEOF, SKIP_GCC_ASM, SKIP_GCC_ATTRIBUTE, STATIC, STRING_L, STRING_WL, STRUCT, SWITCH, TYPEDEF, TYPEDEF_NAME, UINT_CONST, ULONG_CONST, ULONGLONG_CONST, UNION, UNSIGNED, VOID, VOLATILE, WHILE |
| Fields inherited from interface coins.ast.TypeId |
ARRAY_T, CHAR_T, CONST_T, DOUBLE_T, ELLIPSIS_T, ENUM_BEGIN, ENUM_END, FLOAT_T, FUNCTION_T, INT_T, LONG_DOUBLE_T, LONG_LONG_T, LONG_T, NO_DIMENSION_T, OFFSET_T, POINTER_T, RESTRICT_T, RETURN_T, S_AUTO, S_EXTERN, S_INLINE, S_NONE, S_REGISTER, S_STATIC, SHORT_T, SIGNED_T, SIZE_T, STRUCT_BEGIN, STRUCT_END, UNION_BEGIN, UNION_END, UNSIGNED_T, VOID_T, VOLATILE_T |
|
Constructor Summary |
Lex(IoRoot ioroot,
java.io.InputStream s)
Constructs a lexical analyzer. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ioRoot
final IoRoot ioRoot
debug
final Debug debug
warning
final Message warning
error
final Message error
parser
Parser parser
fDbgLevel
public final int fDbgLevel
Lex
public Lex(IoRoot ioroot,
java.io.InputStream s)
- Constructs a lexical analyzer.
get
public int get()
throws java.io.IOException
- Throws:
java.io.IOException
lookAhead
public int lookAhead()
throws java.io.IOException
- Looks at the next token.
- Throws:
java.io.IOException
lookAhead
public int lookAhead(int i)
throws java.io.IOException
- Looks at the n-th token.
- Parameters:
i - equal to or more than zero
- Throws:
java.io.IOException
getLineNumber
public int getLineNumber()
getFileName
public java.lang.String getFileName()
getString
public java.lang.String getString()
getLong
public long getLong()
getDouble
public double getDouble()
isType
public boolean isType(int pTokenId)
getTextBuffer
public java.lang.StringBuffer getTextBuffer()
checkExtendedKeywords
protected int checkExtendedKeywords(java.lang.StringBuffer sbuf)