diff options
author | Mark Spruiell <mes@zeroc.com> | 2012-05-16 17:06:00 -0700 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2012-05-16 17:06:00 -0700 |
commit | 1c6024e41f697d61b2727dc60c8aa6f62e9f5660 (patch) | |
tree | a1fe8e5ff322f02adef32c3edaf48b3d947cd6f0 /cpp/src/Slice/Scanner.l | |
parent | * Ruby port of sliced/compact/preserved (diff) | |
download | ice-1c6024e41f697d61b2727dc60c8aa6f62e9f5660.tar.bz2 ice-1c6024e41f697d61b2727dc60c8aa6f62e9f5660.tar.xz ice-1c6024e41f697d61b2727dc60c8aa6f62e9f5660.zip |
parser support for optional data members
Diffstat (limited to 'cpp/src/Slice/Scanner.l')
-rw-r--r-- | cpp/src/Slice/Scanner.l | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/cpp/src/Slice/Scanner.l b/cpp/src/Slice/Scanner.l index 24ee3543b04..f9a5df88a42 100644 --- a/cpp/src/Slice/Scanner.l +++ b/cpp/src/Slice/Scanner.l @@ -185,7 +185,19 @@ floating_literal (({fractional_constant}{exponent_part}?)|((\+|-)?[[:digit:]]+{e { return ICE_IDENT_OP; } - return checkKeyword(ident->v) == ICE_IDENTIFIER ? ICE_IDENT_OP : ICE_KEYWORD_OP; + int st = checkKeyword(ident->v); + if(st == ICE_IDENTIFIER) + { + return ICE_IDENT_OP; + } + else if(st == ICE_OPTIONAL) + { + return ICE_OPTIONAL_OP; + } + else + { + return ICE_KEYWORD_OP; + } } {identifier} { @@ -477,6 +489,7 @@ initScanner() keywordMap["false"] = ICE_FALSE; keywordMap["true"] = ICE_TRUE; keywordMap["idempotent"] = ICE_IDEMPOTENT; + keywordMap["optional"] = ICE_OPTIONAL; } // |