module Cabs:Thrown when an unconsistent C abstract syntax is found.sig..end
val version : stringexception UnconsistentDef
type size =
| |
NO_SIZE |
(* | No size modifier | *) |
| |
SHORT |
(* | "short" modifier | *) |
| |
LONG |
(* | "long" modifier | *) |
| |
LONG_LONG |
(* | GNU "long long" modifier | *) |
type sign =
| |
NO_SIGN |
(* | No sign modifier | *) |
| |
SIGNED |
(* | "signed" modifier | *) |
| |
UNSIGNED |
(* | "unsigned" modifier | *) |
type storage =
| |
NO_STORAGE |
(* | No storage modifier | *) |
| |
AUTO |
(* | "auto" modifier | *) |
| |
STATIC |
(* | "static" modifier | *) |
| |
EXTERN |
(* | "extern" modifier | *) |
| |
REGISTER |
(* | "register" modifier | *) |
type base_type =
| |
NO_TYPE |
(* | Old K&R declaration without type | *) |
| |
VOID |
(* | "void" type | *) |
| |
CHAR of |
(* | "char" type with sign modifier | *) |
| |
INT of |
(* | "int" type with size and sign modifiers | *) |
| |
BITFIELD of |
(* | Bitfield with sign modifier and size expression | *) |
| |
FLOAT of |
(* | "float" type with long (true) modifier | *) |
| |
DOUBLE of |
(* | "doubl" type with long (true) modifier | *) |
| |
PTR of |
(* | Pointer "*" to the given type | *) |
| |
ARRAY of |
(* | Array of the given type with the given expression size (may be NOTHING) | *) |
| |
STRUCT of |
(* | "struct" of the given name (may be empty) with given fields (may also be empty) | *) |
| |
UNION of |
(* | "union" of the given name (may be empty) with given fields (may also be empty) | *) |
| |
PROTO of |
(* | Prototype of a function | *) |
| |
OLD_PROTO of |
(* | Old-style K&R prototype | *) |
| |
NAMED_TYPE of |
(* | Named type coming from typedef | *) |
| |
ENUM of |
(* | "union" of the given name (may be empty) with given values (may also be empty) | *) |
| |
CONST of |
(* | "const" modifier | *) |
| |
VOLATILE of |
(* | "volatile" modifier | *) |
typename =string * base_type * attributes * expression
typename_group =base_type * storage * name list
int v, *p, t[256];.typesingle_name =base_type * storage * name
typeenum_item =string * expression
typeproto =base_type * single_name list * bool
typeold_proto =base_type * string list * bool
type definition =
| |
FUNDEF of |
(* | Definition of a function. | *) |
| |
OLDFUNDEF of |
(* | Definition of an old-C K&R style function. | *) |
| |
DECDEF of |
(* | Declaration of function or definition of a variable. | *) |
| |
TYPEDEF of |
(* | Definition of a typedef. | *) |
| |
ONLYTYPEDEF of |
(* | Definition of lonely "struct", "union" or "enum". | *) |
typefile =definition list
typebody =definition list * statement
type statement =
| |
NOP |
(* | No operation. Useful for empty else-part in condition. | *) |
| |
COMPUTATION of |
(* | A simple expression, usually an assignment. | *) |
| |
BLOCK of |
(* | A block between braces | *) |
| |
SEQUENCE of |
(* | Two statement separated by ";" | *) |
| |
IF of |
(* | "if" statement with or without else-part. | *) |
| |
WHILE of |
(* | "while" statement. | *) |
| |
DOWHILE of |
(* | "do ... while" statement | *) |
| |
FOR of |
(* | "for" statement. | *) |
| |
BREAK |
(* | "break" statement. | *) |
| |
CONTINUE |
(* | "continue" statement. | *) |
| |
RETURN of |
(* | "return" statement with an expression or with NOTHING. | *) |
| |
SWITCH of |
(* | "switch" statement. Cases are put in the sub-statement as labels. | *) |
| |
CASE of |
(* | "case" statement as a label. | *) |
| |
DEFAULT of |
(* | "default" statement as a label. | *) |
| |
LABEL of |
(* | "label" statement whose sub-statement follows colon ":". | *) |
| |
GOTO of |
(* | "goto" statement. | *) |
type binary_operator =
| |
ADD |
(* | "+" operator. | *) |
| |
SUB |
(* | "-" operator. | *) |
| |
MUL |
(* | "*" operator. | *) |
| |
DIV |
(* | "/" operator. | *) |
| |
MOD |
(* | "%" operator. | *) |
| |
AND |
(* | "&&" operator. | *) |
| |
OR |
(* | "||" operator. | *) |
| |
BAND |
(* | "&" operator. | *) |
| |
BOR |
(* | "|" operator. | *) |
| |
XOR |
(* | "^" operator. | *) |
| |
SHL |
(* | "<<" operator. | *) |
| |
SHR |
(* | ">>" operator. | *) |
| |
EQ |
(* | "==" operator. | *) |
| |
NE |
(* | "!=" operator. | *) |
| |
LT |
(* | "<" operator. | *) |
| |
GT |
(* | ">" operator. | *) |
| |
LE |
(* | "<=" operator. | *) |
| |
GE |
(* | ">=" operator. | *) |
| |
ASSIGN |
(* | "=" operator. | *) |
| |
ADD_ASSIGN |
(* | "+=" operator. | *) |
| |
SUB_ASSIGN |
(* | "-=" operator. | *) |
| |
MUL_ASSIGN |
(* | "*=" operator. | *) |
| |
DIV_ASSIGN |
(* | "/=" operator. | *) |
| |
MOD_ASSIGN |
(* | "%=" operator. | *) |
| |
BAND_ASSIGN |
(* | "&=" operator. | *) |
| |
BOR_ASSIGN |
(* | "|=" operator. | *) |
| |
XOR_ASSIGN |
(* | "^=" operator. | *) |
| |
SHL_ASSIGN |
(* | "<<=" operator. | *) |
| |
SHR_ASSIGN |
(* | ">>=" operator. | *) |
type unary_operator =
| |
MINUS |
(* | "-" operator. | *) |
| |
PLUS |
(* | "+" operator. | *) |
| |
NOT |
(* | "!" operator. | *) |
| |
BNOT |
(* | "~" operator. | *) |
| |
MEMOF |
(* | "*" operator. | *) |
| |
ADDROF |
(* | "&" operator. | *) |
| |
PREINCR |
(* | "++" pre-incrementation. | *) |
| |
PREDECR |
(* | "--" pre-decrementation. | *) |
| |
POSINCR |
(* | "++" post-incrementation. | *) |
| |
POSDECR |
(* | "--" post-decrementation. | *) |
type expression =
| |
NOTHING |
(* | Null-expression. Useful for return with no value or table declaration without size. | *) |
| |
UNARY of |
(* | Unary operator use. | *) |
| |
BINARY of |
(* | Binary operator use. | *) |
| |
QUESTION of |
(* | "condition ? then-expression : else-expression" operator. | *) |
| |
CAST of |
(* | "(type)expresson" type casting. | *) |
| |
CALL of |
(* | Function call. | *) |
| |
COMMA of |
(* | Sequence of expression separated with ",". | *) |
| |
CONSTANT of |
(* | Constant value. | *) |
| |
VARIABLE of |
(* | Access to an identifier. | *) |
| |
EXPR_SIZEOF of |
(* | "sizeof" with expression. | *) |
| |
TYPE_SIZEOF of |
(* | "sizeof" with type. | *) |
| |
INDEX of |
(* | Access to an array item; | *) |
| |
MEMBEROF of |
(* | Indirection through ".". | *) |
| |
MEMBEROFPTR of |
(* | Pointer indirection through "->". | *) |
| |
GNU_BODY of |
(* | GNU braces inside an expression. | *) |
type constant =
| |
CONST_INT of |
(* | Integer constant. | *) |
| |
CONST_FLOAT of |
(* | Float constant. | *) |
| |
CONST_CHAR of |
(* | Character constant with escapes resolved. | *) |
| |
CONST_STRING of |
(* | String constant with escapes resolved. | *) |
| |
CONST_COMPOUND of |
(* | Compound values between braces. Only valid for variable initialization. | *) |
typeattributes =attribute list
type attribute =
| |
NO_ATTR |
(* | No attribute "()". | *) |
| |
ATTR_LIST of |
(* | Attribute list between parentheses. | *) |
| |
ATTR_ID of |
(* | Attribute identifier. | *) |