diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-03-04 14:37:43 +0100 |
---|---|---|
committer | Andreas Stöckel <andreas@somweyr.de> | 2015-03-04 14:37:43 +0100 |
commit | 0a05765f86271743a6fa9b79036f56240b8c3c06 (patch) | |
tree | f00ab579c48112d108f8fa63d609ecbbb2016af1 /src/core/model/Syntax.cpp | |
parent | dcd4ef0a20679a28b83e2af321df194232f1fb87 (diff) |
Renamed "start" and "end" token to "open" and "close" token
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; } } |