public class CFactory
extends java.lang.Object
| Constructor and Description |
|---|
CFactory(java.lang.String prefix,
SymbolTable.Scope scope)
Create a new C factory.
|
| Modifier and Type | Method and Description |
|---|---|
Type |
builtin(Type type)
Mark the specified type as builtin.
|
Type |
c()
Get the canonical char type.
|
Type |
cc()
Get a constant char type.
|
Type |
constant(Type type)
Mark the specified type as constant.
|
Type |
cv()
Get a constant void type.
|
CFactory |
decl(boolean nofix,
java.lang.String name,
Type type)
Add the specified declaration to this factory's symbol table
scope.
|
void |
declareBuiltIns(boolean nofix)
Declare built-in functions for C in this factory's symbol table
scope.
|
Type |
f()
Create a new function type with no parameters and a void return
type.
|
Type |
f(Type result)
Create a new function type with no parameters.
|
Type |
f(Type result,
Type param)
Create a new function type.
|
Type |
f(Type result,
Type param1,
Type param2)
Create a new function type.
|
Type |
f(Type result,
Type param1,
Type param2,
Type param3)
Create a new function type.
|
Type |
f(Type result,
Type param1,
Type param2,
Type param3,
Type param4)
Create a new function type.
|
Type |
i()
Get the canonical int type.
|
PointerT |
p(Type type)
Create a new pointer type.
|
Type |
p2c()
Get a pointer to char.
|
Type |
p2cc()
Get a pointer to constant char.
|
Type |
p2cv()
Get a pointer to a constant void.
|
Type |
p2v()
Get a pointer to void.
|
Type |
pr(Type type)
Create a new restricted pointer type.
|
Type |
size()
Get the canonical sizeof type.
|
Type |
v()
Get the canonical void type.
|
public CFactory(java.lang.String prefix,
SymbolTable.Scope scope)
prefix - The prefix for declarations.scope - The symbol table scope.public Type v()
VoidT.TYPE.public Type cv()
public Type c()
NumberT.CHAR.public Type cc()
public Type i()
NumberT.INT.public Type size()
NumberT.SIZEOF.public PointerT p(Type type)
type - The pointed-to type.public Type pr(Type type)
type - The pointed-to type.public Type p2v()
public Type p2cv()
public Type p2c()
public Type p2cc()
public Type f()
public Type f(Type result)
result - The result type.public Type f(Type result, Type param)
result - The result type.param - The parameter type.public Type f(Type result, Type param1, Type param2)
result - The result type.param1 - The first parameter type.param2 - The second parameter type.public Type f(Type result, Type param1, Type param2, Type param3)
result - The result type.param1 - The first parameter type.param2 - The second parameter type.param3 - The third parameter type.public Type f(Type result, Type param1, Type param2, Type param3, Type param4)
result - The result type.param1 - The first parameter type.param2 - The second parameter type.param3 - The third parameter type.param4 - The fourth parameter type.public Type constant(Type type)
type - The type.public Type builtin(Type type)
type - The type.public CFactory decl(boolean nofix, java.lang.String name, Type type)
nofix flag is set, this method also adds a
declaration without this factory's prefix.nofix - The nofix flag.name - The name.type - The type.public void declareBuiltIns(boolean nofix)
nofix - The flag for whether to also declare symbols without
this factory's prefix.Copyright © 2014. All Rights Reserved.