[Xorp-hackers] template files

Bruce M. Simpson bms at icir.org
Mon Jan 21 00:00:21 PST 2008


Arjun Prasad wrote:
> Hi All,
>  
> I have dought regarding the files(template i.e .tp files) .
> As we know these files are read by the rtrmgr in the begining to 
> create template tree.Also we know that these files are read once and 
> not even changed dynamically.
> So can we replace these  files .i mean is there any other option to 
> doing the same job.
>  

I am curious what your reasons are for proposing that the template 
parser be replaced with something else. It seems something of a non 
sequitur, but I'm always open to hearing new ideas.

The implementation using the template files allows for a lot of 
flexibility in extending the syntax of the configuration interpreter. I 
speak from experience, having just written the template files for a 
MANET protocol today which I plan to merge soon.

Providing this level of parser flexibility in a hard-coded way, seems to 
me, to be a lot of cumbersome work, without resorting to the existing 
mechanisms. Whilst it might well be possible to re-engineer the 
architecture so that the parser(s) for individual protocols are 
implemented in some other form of code, is it really desirable or a good 
way to spend time?

There are a number of different paths you could follow, if you are 
strongly of the opinion that replacing the template files with code is 
worthwhile; the ANTLR Parser Generator might be a place to start.

I speculate though that you'll just end up reinventing the wheel which 
we already have.

regards,
BMS



More information about the Xorp-hackers mailing list