diff options
author | albert-github <albert.tests@gmail.com> | 2018-03-26 15:57:42 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2018-03-26 15:57:42 (GMT) |
commit | 6ad7854e72abda652bdf034d7cf355dcb136a7fe (patch) | |
tree | 7c1c43aa2bc4434785317f6a9a820a858f41c477 /vhdlparser/vhdlstring.h | |
parent | 7e2fcd305c8c9377aa958a3d812cc31bc81c0e32 (diff) | |
download | Doxygen-6ad7854e72abda652bdf034d7cf355dcb136a7fe.zip Doxygen-6ad7854e72abda652bdf034d7cf355dcb136a7fe.tar.gz Doxygen-6ad7854e72abda652bdf034d7cf355dcb136a7fe.tar.bz2 |
Adding debug options to vhdl parser generator
JavaCC contains by default options to get more information about the parser paths used (analogous to the -d option of flex).
- Makefile
- adding option (JAVACC_FLAGS) for easier use of JavaCC options
- adding possibility to reset generated files to their git versions.
- vhdlstring.h adding functions required by debug options (debug_token_manager)
Diffstat (limited to 'vhdlparser/vhdlstring.h')
-rw-r--r-- | vhdlparser/vhdlstring.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/vhdlparser/vhdlstring.h b/vhdlparser/vhdlstring.h index fde6ce4..4c64440 100644 --- a/vhdlparser/vhdlstring.h +++ b/vhdlparser/vhdlstring.h @@ -9,6 +9,7 @@ /** @brief Minimal string class with std::string like behaviour that fulfills the JavaCC * string requirements. */ + class VhdlString { public: @@ -93,6 +94,8 @@ class VhdlString void clear() { free(m_str); init(); } VhdlString &operator+=(char c) { char s[2]; s[0]=c; s[1]=0; return append(s); } VhdlString &operator+=(const char *s) { return append(s); } + VhdlString &operator+=(VhdlString s) { return append(s); } + VhdlString operator+ (const char *s) { return append(s); } private: void init() { m_str=(char*)calloc(1,1); m_len=0; } @@ -100,4 +103,9 @@ class VhdlString int m_len; }; +// declare it static otherwise we will get: +// multiple definition of `operator+(char const*, VhdlString)' +// as we are in an include file +static VhdlString operator+ (const char *s, VhdlString v) { return VhdlString(s).append(v); } + #endif |