4 DEBUG_TOKEN_MANAGER=false;
8 PARSER_BEGIN(ESFParser)
12 public class ESFParser
14 private String currentEvent;
15 private EventTemplateDB eventTemplateDB;
17 public void setEventTemplateDB(EventTemplateDB DB)
18 { eventTemplateDB = DB; }
20 public EventTemplateDB getEventTemplateDB()
21 { return eventTemplateDB; }
23 public void setCurrentEvent(String evt)
24 { currentEvent = evt; }
26 public String getCurrentEvent()
27 { return currentEvent; }
38 | "#" : IN_LINE_COMMENT
41 <IN_LINE_COMMENT> SKIP:
48 <IN_LINE_COMMENT> MORE:
56 < ID: ["a"-"z","A"-"Z","_",":","0"-"9"] (["a"-"z","A"-"Z","_",":","0"-"9"])* >
66 event() ( event() )* <EOF>
76 eventName() "{" [ attributeList() ] "}"
80 * The name of an event, should be max 256 chars ([a-zA-Z0-9_]*)
89 if ( getEventTemplateDB().addEvent(t.image))
91 setCurrentEvent(t.image);
95 throw new ParseException("Problem adding event "+t.image);
100 void attributeList() :
103 attribute() ( attribute() )*
112 aType=type() anAttribute=attributeName() ";" {
113 if ( !( aType.equals("uint16")
114 | aType.equals("int16")
115 | aType.equals("uint32")
116 | aType.equals("int32")
117 | aType.equals("string")
118 | aType.equals("ip_addr")
119 | aType.equals("int64")
120 | aType.equals("uint64")
121 | aType.equals("boolean")
125 throw new ParseException("No such type '"+aType+"'");
127 String evt = getCurrentEvent();
128 if ( evt == null ) throw new ParseException("Bad Event");
129 if ( !getEventTemplateDB().addEventAttribute(evt,anAttribute,aType))
131 throw new ParseException("Problem adding attribute "+evt+"("
132 +aType+","+anAttribute+")");
148 String attributeName() :