Envision
A visual programming IDE for object-oriented languages
|
Public Types | |
enum | Type { Identifier , Literal , OperatorDelimiter , PartialLiteral , SubExpression } |
Public Member Functions | |
Token () | |
Token (QString text, Type type) | |
const QString & | text () const |
Type | type () const |
Static Public Member Functions | |
static QVector< Token > | createSubExpressions (const QVector< Token > &tokens) |
static QVector< Token > | tokenize (QString input, const OperatorDescriptorList *ops) |
Static Private Member Functions | |
static int | countUnmatched (QVector< Token >::const_iterator start, QVector< Token >::const_iterator end, QChar openParen, QChar closeParen) |
static QVector< Token > | createSubExpressions (QVector< Token >::const_iterator start, QVector< Token >::const_iterator end, QChar openParen, QChar closeParen) |
static bool | findSplit (QVector< Token >::const_iterator &splitStart, QVector< Token >::const_iterator &splitEnd, QChar openParen, QChar closeParen) |
Adjusts the splitStart and splitEnd arguments to indicate the best split of the given range and returns true if a split was found. More... | |
static Token | parseIdentifier (QString::const_iterator &it, const QString::const_iterator end, const OperatorDescriptorList *ops) |
static Token | parseNumberLiteral (QString::const_iterator &it, const QString::const_iterator end) |
static Token | parseOperator (QString::const_iterator &it, const QString::const_iterator end, const OperatorDescriptorList *ops) |
static Token | parseStringLiteral (QString::const_iterator &it, const QString::const_iterator end) |
static bool | tokenExistsInOperators (QString token, const OperatorDescriptorList *ops) |
Private Attributes | |
ParseResult | subExpressionResult_ {} |
QVector< Token > | subExpressionTokens_ {} |
QString | text_ |
Type | type_ |
Static Private Attributes | |
static QStringList | specialSignatureWords_ = {"SPACE", "EXPR", "ID"} |
Friends | |
class | Parser |
Interaction::Token::Token | ( | ) |
Interaction::Token::Token | ( | QString | text, |
Type | type | ||
) |
|
staticprivate |
|
staticprivate |
|
staticprivate |
Adjusts the splitStart and splitEnd arguments to indicate the best split of the given range and returns true if a split was found.
If the return value is false the input sequence of tokens should remain as it is.
The range is given by the initial values of splitStart and splitEnd. The returned values are such that: tokens before splitStart should remain as they are (there is no open paren); splitStart points just after the first open paren; splitEnd points at the closing paren that matches the one from splitStart.
The best possible split is determined by trying to minimize the sum of the unmatched count of the tokens: between splitStart and splitEnd; after splitEnd
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
inline |
|
staticprivate |
|
static |
|
inline |
|
friend |
|
staticprivate |
|
private |
|
private |
|
private |
|
private |