[antlr-interest] regarding gcc C grammar

Desai Nishitkumar Ashokkumar nadesai at cse.iitb.ac.in
Tue Dec 13 08:20:16 PST 2005


Hi monty,

     I am trying to parse linux kernel using the gcc grammar (by 
monty) given in ANTLR, but it gives some error.

Following code is part of the preprocesed kernel code and it is not parsed
by gcc grammar given at ... http://www.antlr.org/grammar/cgram/.

-------------------------------

static inline __attribute__((always_inline)) void set_bit(int nr, volatile
unsigned long * addr)
{
  __asm__ __volatile__( ""
   "btsl %1,%0"
   :"=m" ((*(volatile long *) addr))
   :"Ir" (nr));
}

---------------------------------

Can anyone please help me out in this ? In
http://www.antlr.org/grammar/cgram//announce.txt it is written that it is
tested on linux kernel. So, does anyone have any new/changed grammar for 
gcc C ? or Can anyone please tell me that which rules I have to add to 
successfully parse the kernel code.

-- 
Nishit Desai
M.Tech II year 
Computer Science & Engg.
IIT Bombay


More information about the antlr-interest mailing list