I am a newbie in both Irony and parsing. I need some help to find the right approach in a case. I created a Grammar for SQL select statements. Everything is working and I am quite impressed with the expressivenes of Irony (I love using C# to express
my grammar). Now I would like to use Irony and replace dynamically some text.
Lets say I parse "SELECT A, B, C FROM TABLE1, TABLE2". I would like to replace the field A with a new text (say REAL_A). What is the best way for doing it? I want to identify the fields and only do this replacement for field names and not for tables.
My grammar has got "Identifier" as a NonTerminal and this is used for field names and table names. Now I would like to intercept the parsing of identifiers that are used for field names and then transform the content using some internal rules.
Is the Reduced event for the NonTerminals the right one? How could I see if the "Identifier" was in a field list or a table list? How could I replace the text with new one?
Sorry for the many questions