summaryrefslogtreecommitdiffstats
path: root/lib/antlr/antlr/ANTLRUtil.h
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2020-12-17 20:50:19 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2020-12-17 23:51:16 +0900
commit4ae7b32dc09eb7acd9411a8af63a767660aa64ec (patch)
tree3d150131675502f5d5a3ff054ec6fc3dbe4e78fd /lib/antlr/antlr/ANTLRUtil.h
parent25071ecede33675972c3163f4b46df964a06dadf (diff)
downloadtdevelop-4ae7b32dc09eb7acd9411a8af63a767660aa64ec.tar.gz
tdevelop-4ae7b32dc09eb7acd9411a8af63a767660aa64ec.zip
Renaming of files in preparation for code style tools.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit 3e3d9eda9d1dd8c67c1c27c6a9bdc68bdecfcc30)
Diffstat (limited to 'lib/antlr/antlr/ANTLRUtil.h')
-rw-r--r--lib/antlr/antlr/ANTLRUtil.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/lib/antlr/antlr/ANTLRUtil.h b/lib/antlr/antlr/ANTLRUtil.h
new file mode 100644
index 00000000..33f37792
--- /dev/null
+++ b/lib/antlr/antlr/ANTLRUtil.h
@@ -0,0 +1,53 @@
+#ifndef INC_ANTLRUtil_h__
+#define INC_ANTLRUtil_h__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.h>
+#include <iostream>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/** Eat whitespace from the input stream
+ * @param is the stream to read from
+ */
+ANTLR_USE_NAMESPACE(std)istream& eatwhite( ANTLR_USE_NAMESPACE(std)istream& is );
+
+/** Read a string enclosed by '"' from a stream. Also handles escaping of \".
+ * Skips leading whitespace.
+ * @param in the istream to read from.
+ * @returns the string read from file exclusive the '"'
+ * @throws ios_base::failure if string is badly formatted
+ */
+ANTLR_USE_NAMESPACE(std)string read_string( ANTLR_USE_NAMESPACE(std)istream& in );
+
+/* Read a ([A-Z][0-9][a-z]_)* kindoff thing. Skips leading whitespace.
+ * @param in the istream to read from.
+ */
+ANTLR_USE_NAMESPACE(std)string read_identifier( ANTLR_USE_NAMESPACE(std)istream& in );
+
+/** Read a attribute="value" thing. Leading whitespace is skipped.
+ * Between attribute and '=' no whitespace is allowed. After the '=' it is
+ * permitted.
+ * @param in the istream to read from.
+ * @param attribute string the attribute name is put in
+ * @param value string the value of the attribute is put in
+ * @throws ios_base::failure if something is fishy. E.g. malformed quoting
+ * or missing '='
+ */
+void read_AttributeNValue( ANTLR_USE_NAMESPACE(std)istream& in,
+ ANTLR_USE_NAMESPACE(std)string& attribute,
+ ANTLR_USE_NAMESPACE(std)string& value );
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif