[antlr-interest] Displaying base code after parsing

Tov, Amatzia ATov at nds.com
Tue Mar 15 23:23:33 PST 2005


Hi,

I would like to change the base code (in Java) and add a line of text at the beginning and end of every method, like so:

public int compareTo(Object o)
{ 
ADDED_ENTRY_TEXT;
{
	return 0;
}
ADDED_EXIT_TEXT;
}

I've managed to identify the entry/exit points using a tree parser, but now I want to write the base code (with the changes) to a file.

The problem is, that I can't use a filter in the tree parser which identifies the entry / exit points. 

The filter option is legal only in Lexer classes, but the lexer cannot find the entry / exit points.

I'd be glad if someone could help..

Thanks,

Amatzia 
***********************************************************************************
Information contained in this email message is intended only for use of the individual or entity named above. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the postmaster at nds.com and destroy the original message.
***********************************************************************************


More information about the antlr-interest mailing list