I'm a student working on a compiler front end to nesC. Are there manuals that
document the internals of nesC source code-- particularly the intermediate
representation trees? If I'm to use the gcc internal manuals, which version of
gcc is the closest to the current nesC source?
From: David Gay <dgay42@gm...> - 2006-12-07 17:41:05
On 11/7/06, Dasarath Weeratunge <dweeratu@...> wrote:
> I'm a student working on a compiler front end to nesC. Are there manuals that
> document the internals of nesC source code-- particularly the intermediate
> representation trees? If I'm to use the gcc internal manuals, which version of
> gcc is the closest to the current nesC source?
Sorry for the delay (this came just before the PLDI deadline, so got lost ;-)).
The frontend is based on gcc-2.8.1. What it shares is basically the
control structure, and execution logic with gcc's frontend (lexing,
parsing, type checking, errors, etc - a number of the functions still
have the same name and behaviour as the gcc ones). It has completely
different data structures (gcc 2.8 has, e.g., no abstract syntax
The AST is defined in the nodetypes.def file, which defines an OO-ish
data structure (various kinds of nodes inheriting from each other,
each node kind has its own fields and inherits some from its parent).
Code is generated from that for the types, to walk over the AST, to
print ASTs, etc.
Types are represented by the 'type' type, with a bunch of
access/creation functions in types.h.
Declarable things (variables, structures, etc) are represented by
unique "declaration" objects. The types for these are defined in
decls.h (data_declaration, tag_declaration, etc) and nesc-decls.h
I haven't written an overall description of the compilation process
however (at the highest level: recursively load and check everything,
instantiate abstract components and resolve the component graph,
generate C code).
Get latest updates about Open Source Projects, Conferences and News.