summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/GrammarUtil.h
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2002-07-02 07:36:44 +0000
committerMichi Henning <michi@zeroc.com>2002-07-02 07:36:44 +0000
commite4fe14cf93b5f9dd28027193b7bf9529b218e517 (patch)
treee57f7f9427b2f8ece33b9bb30c67010cef3cb390 /cpp/src/Slice/GrammarUtil.h
parentFixed over-zealous case-insensitivity check lookupTypeNoBuiltin, (diff)
downloadice-e4fe14cf93b5f9dd28027193b7bf9529b218e517.tar.bz2
ice-e4fe14cf93b5f9dd28027193b7bf9529b218e517.tar.xz
ice-e4fe14cf93b5f9dd28027193b7bf9529b218e517.zip
Changed [] syntax to disallow empty metadata: you now have to either have
metadata with at least one string in the list, or no metadata at all. Updated scanner so backslash-escaped keywords can be used as identifiers. Removed ''-style strings from scanner -- only ""-style is now legal. Changed string literals to fully conform with ISO-C++ rules. (Not all legal escape sequences were supported previously.) Changed grammar to support concatenation of adjacent string literals. Added support for constants. Parser and scanner are complete, but the action for a constant definition is empty for now. Constant definitions are supported for bool, byte, integers, floating point, strings, and enums. Constants can be defined at global scope and module scope (nowhere else). Syntax follows C++ syntax as much as it makes sense (e.g., the l and u suffixes for integer constants are not supported).
Diffstat (limited to 'cpp/src/Slice/GrammarUtil.h')
-rw-r--r--cpp/src/Slice/GrammarUtil.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/cpp/src/Slice/GrammarUtil.h b/cpp/src/Slice/GrammarUtil.h
index 591fa976eed..bc349184dc0 100644
--- a/cpp/src/Slice/GrammarUtil.h
+++ b/cpp/src/Slice/GrammarUtil.h
@@ -22,6 +22,8 @@ class StringListTok;
class TypeStringTok;
class TypeStringListTok;
class BoolTok;
+class IntegerTok;
+class FloatingTok;
class ExceptionListTok;
class ClassListTok;
class EnumeratorListTok;
@@ -31,6 +33,8 @@ typedef ::IceUtil::Handle<StringListTok> StringListTokPtr;
typedef ::IceUtil::Handle<TypeStringTok> TypeStringTokPtr;
typedef ::IceUtil::Handle<TypeStringListTok> TypeStringListTokPtr;
typedef ::IceUtil::Handle<BoolTok> BoolTokPtr;
+typedef ::IceUtil::Handle<IntegerTok> IntegerTokPtr;
+typedef ::IceUtil::Handle<FloatingTok> FloatingTokPtr;
typedef ::IceUtil::Handle<ExceptionListTok> ExceptionListTokPtr;
typedef ::IceUtil::Handle<ClassListTok> ClassListTokPtr;
typedef ::IceUtil::Handle<EnumeratorListTok> EnumeratorListTokPtr;
@@ -84,6 +88,30 @@ public:
};
// ----------------------------------------------------------------------
+// IntegerTok
+// ----------------------------------------------------------------------
+
+class SLICE_API IntegerTok : public GrammarBase
+{
+public:
+
+ IntegerTok() { }
+ long v;
+};
+
+// ----------------------------------------------------------------------
+// FloatingTok
+// ----------------------------------------------------------------------
+
+class SLICE_API FloatingTok : public GrammarBase
+{
+public:
+
+ FloatingTok() { }
+ double v;
+};
+
+// ----------------------------------------------------------------------
// BoolTok
// ----------------------------------------------------------------------