next up previous
Next: The visitor Up: Gasta architecture Previous: Gasta architecture
Gasta Homepage: Home page

The parser

The parser is written using the powerful tools bison and flex. The grammar is very simple. The compiler gcc produces a file like :

Figure 2: Output produced by gcc
\fbox{\begin{minipage}{7cm}
\begin{small}
\begin{tabbing}
tttt \=
tttttttttttttt...
...\>\>extern\\
\>\>body:~@7\\
@4\>...\\
\end{tabbing}\end{small}\end{minipage}}

Our grammar identifies the different parts of the file like :

According to the previous definitions, a node of the graph is the association of three items: Its number, its identifier and a list of tags that describe it. So, during the parse, we construct a list of tags. When all tags are added to the list, we prepend the identifier and the node is stored in a hash table. The key to access a particular node in the hash table is its number.



Guillaume Thouvenin 2001-10-01