|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Object | +--coins.cfront.Parser
Parser for the C language.
フィールドの概要 | |
static java.lang.String |
cppCommand
The command string for invoking a preprocessor. |
(パッケージプライベート) Debug |
debug
|
(パッケージプライベート) Evaluator |
evaluator
|
int |
fDbgLevel
|
static java.lang.String |
invalidCChar
Used to generate an identifier that never appears in a source program. |
(パッケージプライベート) Lex |
lex
|
(パッケージプライベート) java.util.LinkedList |
pragmaList
|
インタフェース 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 |
インタフェース 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 |
コンストラクタの概要 | |
Parser(IoRoot ioroot,
Lex lex,
ToHirC tohirc)
Constructs a parser. |
メソッドの概要 | |
protected java.lang.String |
decodeTagName(java.lang.String tagName)
|
protected void |
enterNewEnvironment()
|
protected void |
exitEnvironment()
|
SymbolTable |
getCurrentSymbolTable()
|
protected java.lang.String |
getNewEncodedTag(java.lang.String name)
|
boolean |
hasNext()
Returns false if the parser reaches the end of file. |
(パッケージプライベート) boolean |
isTypedefedType(java.lang.String typename)
|
protected Aggregate |
lookupEncodedTag(java.lang.String tagName)
|
protected Declarator |
makeDeclarator(java.lang.String name,
java.lang.String fname,
int line)
Creates a Declarator object.
|
protected Function |
makeFunction(Declarator decl,
Stmnt body)
Creates a Function object.
|
protected Struct |
makeStruct(java.lang.String name,
DeclaratorList mems,
java.lang.String fname,
int line)
Creates a Struct object.
|
protected Union |
makeUnion(java.lang.String name,
DeclaratorList mems,
java.lang.String fname,
int line)
Creates a Union object.
|
void |
parse(Backend backend,
boolean verbose)
Parses the whole source file. |
ASTList |
read()
Reads a top-level declaration and returns a parse tree. |
void |
recordSymbol(java.lang.String name,
Declarator d)
|
protected java.lang.String |
recordTag(java.lang.String tagName)
Declares that a struct/union will be declared later in the current name scope. |
protected void |
recordTag(java.lang.String tagName,
Aggregate a)
|
static java.io.InputStream |
runCpp(java.lang.String source)
Runs a preprocessor (gcc -E) and returns the input stream obtaining the output of the preprocessor. |
void |
showEpilogue()
|
protected void |
showErrorMessage(ParseError e)
|
void |
showErrorMessage(Stmnt pos,
java.lang.String message)
|
void |
showWarningMessage(java.lang.String message)
|
long |
sizeofStruct(java.lang.String tagName)
|
long |
sizeofUnion(java.lang.String tagName)
|
protected java.lang.String |
toEncodedTag(java.lang.String tagName)
Returns a new unique tag name if the given tag name overrides another one declared in an outer scope. |
クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
フィールドの詳細 |
public static final java.lang.String invalidCChar
final Debug debug
final Lex lex
Evaluator evaluator
java.util.LinkedList pragmaList
public final int fDbgLevel
public static java.lang.String cppCommand
コンストラクタの詳細 |
public Parser(IoRoot ioroot, Lex lex, ToHirC tohirc)
lex
- a lexical analyzerメソッドの詳細 |
public static java.io.InputStream runCpp(java.lang.String source) throws java.io.IOException
java.io.IOException
boolean isTypedefedType(java.lang.String typename)
public void parse(Backend backend, boolean verbose) throws java.io.IOException
Backend.compile()
.
See cfront.Backend#compile(ast.ASTList)
verbose
- true if an epilogue message is printed out.
java.io.IOException
public boolean hasNext() throws java.io.IOException
java.io.IOException
protected Declarator makeDeclarator(java.lang.String name, java.lang.String fname, int line)
Declarator
object.
This method should be overwritten if the client provides
a subclass of
Declarator
and the parser must instantiate that
subclass. The implementation in this class is as follows:
return new Declarator(name, fname, line);
protected Function makeFunction(Declarator decl, Stmnt body)
Function
object.
This method should be overwritten if the client provides
a subclass of
Function
and the parser must instantiate that
subclass. The implementation in this class is as follows:
return new Function(decl, body);
protected Struct makeStruct(java.lang.String name, DeclaratorList mems, java.lang.String fname, int line)
Struct
object.
This method should be overwritten if the client provides
a subclass of
Struct
and the parser must instantiate that
subclass. The implementation in this class is as follows:
return new Struct(name, mems, fname, line);
protected Union makeUnion(java.lang.String name, DeclaratorList mems, java.lang.String fname, int line)
Union
object.
This method should be overwritten if the client provides
a subclass of
Union
and the parser must instantiate that
subclass. The implementation in this class is as follows:
return new Union(name, mems, fname, line);
protected void showErrorMessage(ParseError e)
public void showErrorMessage(Stmnt pos, java.lang.String message)
public void showWarningMessage(java.lang.String message)
public void showEpilogue()
public void recordSymbol(java.lang.String name, Declarator d)
protected void enterNewEnvironment()
protected void exitEnvironment()
protected Aggregate lookupEncodedTag(java.lang.String tagName)
protected java.lang.String toEncodedTag(java.lang.String tagName)
protected java.lang.String decodeTagName(java.lang.String tagName)
protected java.lang.String getNewEncodedTag(java.lang.String name)
protected java.lang.String recordTag(java.lang.String tagName) throws ParseError
ParseError
protected void recordTag(java.lang.String tagName, Aggregate a) throws ParseError
ParseError
public long sizeofStruct(java.lang.String tagName) throws ParseError
ParseError
public long sizeofUnion(java.lang.String tagName) throws ParseError
ParseError
public ASTList read() throws java.io.IOException
struct A { int a; } var_a;is divided into the following two simple declarations:
struct A { int a; }; // type declaration struct A var_a; // variable declaration
Note that this method may return null.
java.io.IOException
public SymbolTable getCurrentSymbolTable()
|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |