diff options
author | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2015-03-04 14:48:44 +0100 |
---|---|---|
committer | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2015-03-04 14:48:44 +0100 |
commit | 11c6272abc2b34d861620b906bdee595674dca0f (patch) | |
tree | 3c5568c0653ade15d6f56078eb216418f0dade29 /src/core/model/Syntax.cpp | |
parent | d6d08ae2dfc31c583f172c74ef9e19b203776107 (diff) | |
parent | 2714f95ab3c8632686d24ff8d2abfc1f35dc5dd7 (diff) |
Merge branch 'master' of somweyr.de:ousia
Diffstat (limited to 'src/core/model/Syntax.cpp')
-rw-r--r-- | src/core/model/Syntax.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/core/model/Syntax.cpp b/src/core/model/Syntax.cpp index bd17bff..a97acf7 100644 --- a/src/core/model/Syntax.cpp +++ b/src/core/model/Syntax.cpp @@ -16,13 +16,21 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "Syntax.hpp" +#include <core/common/Utils.hpp> #include "Ontology.hpp" +#include "Syntax.hpp" namespace ousia { -/* Class TokenSyntaxDescriptor */ +/* Class TokenDescriptor */ + +bool TokenDescriptor::isValid() const +{ + return special || isEmpty() || Utils::isUserDefinedToken(token); +} + +/* Class SyntaxDescriptor */ bool SyntaxDescriptor::isAnnotation() const { @@ -39,11 +47,11 @@ bool SyntaxDescriptor::isStruct() const void SyntaxDescriptor::insertIntoTokenSet(TokenSet &set) const { - if (start != Tokens::Empty) { - set.insert(start); + if (open != Tokens::Empty) { + set.insert(open); } - if (end != Tokens::Empty) { - set.insert(end); + if (close != Tokens::Empty) { + set.insert(close); } if (shortForm != Tokens::Empty) { set.insert(shortForm); @@ -52,7 +60,7 @@ void SyntaxDescriptor::insertIntoTokenSet(TokenSet &set) const bool SyntaxDescriptor::isEmpty() const { - return start == Tokens::Empty && end == Tokens::Empty && + return open == Tokens::Empty && close == Tokens::Empty && shortForm == Tokens::Empty; } } |