From 0a05765f86271743a6fa9b79036f56240b8c3c06 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Wed, 4 Mar 2015 14:37:43 +0100 Subject: Renamed "start" and "end" token to "open" and "close" token --- src/core/model/Syntax.cpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'src/core/model/Syntax.cpp') 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 . */ -#include "Syntax.hpp" +#include #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; } } -- cgit v1.2.3