Hi everyone,
I have a very simple problem described below and I don`t have a best way to
solve it. The idea is to parse values in each Basket and populate POJO
representing the Basket.
Basket 200
state California 246
employee 678
phone 555-9000 ext 90009
zip 0909090
Basket 300
state NY 787
emp.....
phone .......
zip......
My parser parses the first line 'state California 246' and then moves to
another basket. I want to recursively parse each line under basket and at
the end populate POJO and then move to another basket.
So any help would be appreciated.
Thx
H
Grammar below
basket
@init {
Basket basket;
String state= "";
String employee= "";
String phone= "";
String zip= "";
}
@after {
basket= new Basket(state, employee);
basket.setPhone(phone);
this.somelist.addBakets(basket);
print(basket.toString());
//start again
parse(); --------? Is this right approach
}
: 'state' st=TOKEN { state= $st.text; }
| 'employee' et=TOKEN { employee= $et.text; }
| 'phone' pt=TOKEN { phone= $pt.text; }
| 'zip'
;
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en.