aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-02-19 14:55:49 +0900
committerHarald Welte <laforge@gnumonks.org>2011-02-19 14:55:49 +0900
commit49b12363b91102a79d1428ddafd97abeca068db2 (patch)
tree81804000712888240270d8764aca7415a34d1a04
parent334493f3b253438a4393c9a470a091799c65578c (diff)
add 'enum ID' options to IE and PDU definition
We don't actually have a way how to define enum's yet, but this will be next.
-rw-r--r--osmo_codegen.g17
1 files changed, 13 insertions, 4 deletions
diff --git a/osmo_codegen.g b/osmo_codegen.g
index 68125e9..fe45cef 100644
--- a/osmo_codegen.g
+++ b/osmo_codegen.g
@@ -18,7 +18,9 @@ tokens {
root :
(pdu_spec | ie_spec | ie_alias)*
- -> ^(IE_SPECS ie_spec*) ^(IE_ALIASES ie_alias*) ^(PDU_SPECS pdu_spec*)
+ -> ^(IE_SPECS ie_spec*)
+ ^(IE_ALIASES ie_alias*)
+ ^(PDU_SPECS pdu_spec*)
;
/* INFORMATION ELEMENTS */
@@ -53,7 +55,7 @@ ie_field_type
| 'bcd' // BCD digits, always 'lower nibble, upper nibble, lower nibble, ...
);
ie_field_opt
- : (field_val | ie_field_cond | ie_field_endian)
+ : (field_val | ie_field_cond | ie_field_endian | ie_field_enum)
;
ie_field_cond
: 'if (' ie_field_name ('&' ie_field_cond_mask)? COMP_OP ie_field_cond_reference ')'
@@ -68,7 +70,10 @@ ie_field_endian
| 'little' -> ^(IEFIELD_ENDIAN 'little')
)
;
-
+ie_field_enum
+ : 'enum' ID -> ^('enum' ID)
+ ;
+
/* PDU DEFINITIONS*/
@@ -97,7 +102,7 @@ pdu_field_size
;
pdu_field_opts
- : pdu_up_downlink | pdu_opt_ie
+ : pdu_up_downlink | pdu_opt_ie | pdu_opt_enum
;
pdu_up_downlink
: 'uplink_only' | 'downlink_only'; // only valid in uplink or downlink
@@ -105,6 +110,10 @@ pdu_opt_ie
: 'ie' ID // use speciifed IE definition
-> ^('ie' ID)
;
+pdu_opt_enum
+ : 'enum' ID
+ -> ^('enum' ID)
+ ;
pdu_field_type
: (