Method Summary |
|
public SymbolTable | analyze(Node unit) Analyze the specified translation unit.
Parameters: unit - The translation unit. |
public SymbolTable | analyze(Node unit, SymbolTable table) Process the specified translation unit.
Parameters: unit - The translation unit. Parameters: table - The symbol table. |
public C | c() Get this analyzer's common type operations for the C language. |
protected void | checkDefinedLabels(GNode function) Check that all labels defined in the specified top-level function
are also used. |
public boolean | checkType(GNode node, String name, Type type) Check that the specified type is well-formed. |
protected void | checkUsedLabels(GNode function) Check that all labels used in the specified top-level function
are also defined. |
public Type | compose(GNode decl, String name, Type type, Type previous, boolean isFuncDef) Compose the specified type with the type of the previous
declaration. |
public void | defineExtern(String name, Type type) Define the specified name in the scope for extern declarations. |
public boolean | ensureArithmetic(Node n, Type t) Ensure that the specified node with the specified type represents
an arithmetic type.
Parameters: n - The node. Parameters: t - The type. |
public boolean | ensureInteger(Node n, Type t) Ensure that the specified note with the specified type represents
an integer.
Parameters: n - The node. Parameters: t - The type. |
public boolean | ensureLValue(Node n, Type t) Ensure that the specified node with the specified type represents
a modifiable lvalue.
Parameters: n - The node. Parameters: t - The type. |
public boolean | ensurePointerArithmetic(Node n, Type t) Ensure that the specified node represents valid pointer
arithmetic for the specified type. |
public boolean | ensureScalar(Node n, Type t) Ensure that the specified node with the specified type represents
a scalar.
Parameters: n - The node. Parameters: t - the type. |
public static GNode | getDeclaredId(GNode declarator) Get the declared identifier from the specified declarator.
Parameters: declarator - The declarator, which may be abstract ornull . |
public Type | getDeclaredType(Type base, GNode declarator) Get the declared type. |
public Type | getDeclaredType(boolean isParam, Type base, GNode declarator) Get the declared type. |
public static GNode | getFunctionDeclarator(GNode declarator) Get the innermost function declarator from the specified
declarator. |
public FunctionT | getParameterTypes(GNode parameters) Get the parameter types for the specified parameter declaration.
As a side effect, this method reports any errors in a parameter's
declaration specifiers, any void parameters (besides a single
void specifier), any multiple parameters in old-style
declarations, and any parameter redefinitions in new-style
declarations.
Parameters: parameters - The parameters, which may be null . |
public static GNode | getSpecifier(String name, GNode specifiers) Get the first declaration specifier with the specified name.
Parameters: name - The name. Parameters: specifiers - The specifiers. |
public static boolean | isFunctionScope(String name) Determine whether the specified scope name represents a function
or macro scope.
Parameters: name - The name. |
protected boolean | isInitializable(Type t1, Type t2) Determine whether the specified left-hand type can be initialized
from the specified right-hand type.
Parameters: t1 - The left-hand type. Parameters: t2 - The right-hand type. |
public boolean | isVoidParameterTypeList(GNode parameters) Determine whether the specified parameter type list represents a
function taking no arguments. |
public Type | lookupExtern(String name) Look up the specified name in the scope for extern declarations.
Parameters: name - The name. |
public void | mark(Node node, Type type) Mark the specified node with the specified type. |
public Specifiers | newSpecifiers(GNode specifiers, boolean refIsDecl) Create a new sequence of specifiers. |
protected Type | processAddress(GNode n, Type type) Process the specified address expression. |
protected Type | processAssignment(boolean init, String op, Node n, Type t1, Type t2) Process the assignment. |
public Type | processExpression(Node n) Process the specified expression node. |
protected Type | processIndirection(Node n, Type type, boolean warn) Process the specified indirection expression.
Parameters: n - The node. Parameters: type - The type. Parameters: warn - The flag for whether to emit any warnings. |
protected Type | processInitializer(GNode expr, String name, Type left, GNode literal) Process the specified initializer. |
protected Type | processOffset(Type base, GNode selection) Process the specified offset selection.
Parameters: base - The base type. Parameters: selection - The selection. |
protected void | processParameters(GNode node, FunctionT function) Process the specified function's parameters. |
protected Type | processSelection(Node node, Type type, String name, boolean indirect) Process a component selection. |
protected Type | processStringSize(GNode expr, String desc, boolean nested, Type left, Type right) Process the string sizes for the specified types. |
protected Type | processSubscript(Node n, Type base, Type index) Process the specified subscript expression.
Parameters: n - The node. Parameters: base - The base type. Parameters: index - The index type. |
public void | reportPrevious(String name, Type type) Report a previous declaration or definition. |
public void | reportPreviousTag(Type type) Report a previous declaration or definition of the specified
tagged type. |
public List<Attribute> | toAttributeList(GNode spec) Convert the specified GCC attribute specifier or GCC attribute
specifier list to an xtc attribute list. |
public String | toAttributeName(String s) Convert the specified string to an attribute name.
Parameters: s - The string. |
public Object | toAttributeValue(GNode node) Convert the specified node to an attribute value. |
public static String | toDescription(Node n) Convert the specified node representing an operand to its
description.
Parameters: n - The node. |
public static Type | toFuncType(String name) Create __func__ 's type for the function with the
specified name.
Parameters: name - The function name. |
public static String | toFunctionName(Node n) Convert the specified node representing a function to its
name.
Parameters: n - The node. |
protected Type | valueConditional(Type result, Type t1, Type t2, Type t3) Determine a conditional expression's value. |
public void | visit(GNode n) Visit the specified generic node. |
public Type | visitAdditiveExpression(GNode n) Visit the specified additive expression. |
public Type | visitAddressExpression(GNode n) Visit the specified address expression. |
public Type | visitAlignofExpression(GNode n) Visit the specified alignof expression. |
public Type | visitAssignmentExpression(GNode n) Visit the specified assignment expression. |
public Type | visitBitwiseAndExpression(GNode n) Visit the specified bitwise and expression. |
public Type | visitBitwiseNegationExpression(GNode n) Visit the specified bitwise negation expression. |
public Type | visitBitwiseOrExpression(GNode n) Visit the specified bitwise or expression. |
public Type | visitBitwiseXorExpression(GNode n) Visit the specified bitwise xor expression. |
public void | visitBreakStatement(GNode n) Visit the specified break statement. |
public void | visitCaseLabel(GNode n) Visit the specified case label. |
public Type | visitCastExpression(GNode n) Visit the specified cast expression. |
public Type | visitCharacterConstant(GNode n) Visit the specified character constant. |
public Type | visitCommaExpression(GNode n) Visit the specified comma expression. |
public Type | visitCompoundLiteral(GNode n) Visit the specified compound literal. |
public Type | visitCompoundStatement(GNode n) Visit the specified compound statement. |
public Type | visitConditionalExpression(GNode n) Visit the specified conditional expression. |
public void | visitContinueStatement(GNode n) Visit the specified continue statement. |
public void | visitDeclaration(GNode n) Visit the specified declaration. |
public void | visitDefaultLabel(GNode n) Visit the specified default label. |
public Type | visitDirectComponentSelection(GNode n) Visit the specified direct component selection. |
public void | visitDoStatement(GNode n) Visit the specified do statement. |
public Type | visitEqualityExpression(GNode n) Visit the specified equality expression. |
public List | visitExpressionList(GNode n) Visit the specified expression list. |
public Type | visitExpressionStatement(GNode n) Visit the specified expression statement. |
public Type | visitExtensionExpression(GNode n) Visit the specified extension expression. |
public Type | visitFloatingConstant(GNode n) Visit the specified floating constant. |
public void | visitForStatement(GNode n) Visit the specified for statement. |
public Type | visitFunctionCall(GNode n) Visit the specified function call. |
public void | visitFunctionDefinition(GNode n) Visit the specified function definition. |
public void | visitGotoStatement(GNode n) Visit the specified goto statement. |
public void | visitIfElseStatement(GNode n) Visit the specified if else statement. |
public void | visitIfStatement(GNode n) Visit the specified if else statement. |
public Type | visitIndirectComponentSelection(GNode n) Visit the specified indirect component selection. |
public Type | visitIndirectionExpression(GNode n) Visit the specified indirection expression. |
public Type | visitIntegerConstant(GNode n) Visit the specified integer constant. |
public Type | visitLabelAddressExpression(GNode n) Visit the specified label address expression. |
public Type | visitLabeledStatement(GNode n) Visit the specified labeled statement. |
public void | visitLocalLabelDeclaration(GNode n) Visit the specified local label declaration. |
public Type | visitLogicalAndExpression(GNode n) Visit the specified logical and expression. |
public Type | visitLogicalNegationExpression(GNode n) Visit the specified logical negation expression. |
public Type | visitLogicalOrExpression(GNode n) Visit the specified logical or expression. |
public Type | visitMultiplicativeExpression(GNode n) Visit the specified multiplicative expression. |
public void | visitNamedLabel(GNode n) Visit the specified named label. |
public Type | visitOffsetofExpression(GNode n) Visit the specified offset of expression. |
public Type | visitPostdecrementExpression(GNode n) Visit the specified postdecrement expression. |
public Type | visitPostincrementExpression(GNode n) Visit the specified postincrement expression. |
public Type | visitPredecrementExpression(GNode n) Visit the specified predecrement expression. |
public Type | visitPreincrementExpression(GNode n) Visit the specified preincrement expression. |
public Type | visitPrimaryIdentifier(GNode n) Visit the specified primary identifier. |
public Type | visitRelationalExpression(GNode n) Visit the specified relational expression. |
public Type | visitReturnStatement(GNode n) Visit the specified return statement. |
public Type | visitShiftExpression(GNode n) Visit the specified shift expression. |
public Type | visitSizeofExpression(GNode n) Visit the specified sizeof expression. |
public Type | visitStatementAsExpression(GNode n) Visit the specified statement as expression. |
public Type | visitStringConstant(GNode n) Visit the specified string constant. |
public Type | visitSubscriptExpression(GNode n) Visit the specified subscript expression. |
public void | visitSwitchStatement(GNode n) Visit the specified switch statement. |
public void | visitTranslationUnit(GNode n) Visit the specified translation unit. |
public Type | visitTypeCompatibilityExpression(GNode n) Visit the specified type compatibility expression. |
public Type | visitTypeName(GNode n) Visit the specified type name. |
public Type | visitUnaryMinusExpression(GNode n) Visit the specified unary minus expression. |
public Type | visitUnaryPlusExpression(GNode n) Visit the specified unary plus expression. |
public Type | visitVariableArgumentAccess(GNode n) Visit the specified variable argument access. |
public void | visitWhileStatement(GNode n) Visit the specified while statement. |