public class TokenQuery extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
TOKEN_TYPE_WHITESPACE |
| Constructor and Description |
|---|
TokenQuery(org.apache.royale.compiler.parsing.IASToken[] tokens) |
| Modifier and Type | Method and Description |
|---|---|
org.apache.royale.compiler.parsing.IASToken |
getCommentAfter(org.apache.royale.compiler.common.ISourceLocation after)
Returns the first comment that appears after the end of a particular
source location.
|
org.apache.royale.compiler.parsing.IASToken |
getCommentBefore(org.apache.royale.compiler.common.ISourceLocation before)
Returns the first comment that appears before the start of a particular
source location.
|
org.apache.royale.compiler.parsing.IASToken[] |
getCommentsInside(org.apache.royale.compiler.tree.as.IASNode node)
Returns all comment tokens inside a node.
|
org.apache.royale.compiler.parsing.IASToken |
getFirstToken(org.apache.royale.compiler.tree.as.IASNode node)
Returns the first token inside a node.
|
org.apache.royale.compiler.parsing.IASToken |
getFirstToken(org.apache.royale.compiler.tree.as.IASNode node,
boolean skipComments,
boolean skipWhitespace)
Returns the first token inside a node, with the option to
skip comment and whitespace tokens.
|
org.apache.royale.compiler.parsing.IASToken |
getLastToken(org.apache.royale.compiler.tree.as.IASNode node)
Returns the last token inside a node.
|
org.apache.royale.compiler.parsing.IASToken |
getLastToken(org.apache.royale.compiler.tree.as.IASNode node,
boolean skipComments,
boolean skipWhitespace)
Returns the last token inside a node, with the option to
skip comment and whitespace tokens.
|
org.apache.royale.compiler.parsing.IASToken |
getNextTokenOfType(org.apache.royale.compiler.common.ISourceLocation after,
int type)
Returns the first token of the specified type that appears after the end
of a particular source location.
|
org.apache.royale.compiler.parsing.IASToken |
getPreviousTokenOfType(org.apache.royale.compiler.common.ISourceLocation before,
int type)
Returns the first token of the specified type that appears before the
start of a particular source location.
|
org.apache.royale.compiler.parsing.IASToken |
getSignificantTokenAfter(org.apache.royale.compiler.common.ISourceLocation after)
Returns the first non-comment, non-whitespace token that appears after
the end of a particular source location.
|
org.apache.royale.compiler.parsing.IASToken |
getSignificantTokenBefore(org.apache.royale.compiler.common.ISourceLocation before)
Returns the first non-comment, non-whitespace token that appears before
the start of a particular source location.
|
org.apache.royale.compiler.parsing.IASToken |
getTokenAfter(org.apache.royale.compiler.common.ISourceLocation sourceLocation)
Returns the token immediately after a source location.
|
org.apache.royale.compiler.parsing.IASToken |
getTokenAfter(org.apache.royale.compiler.common.ISourceLocation sourceLocation,
boolean skipComments,
boolean skipWhitespace)
Returns the token immediately after a source location, with the option to
skip comment and whitespace tokens.
|
org.apache.royale.compiler.parsing.IASToken |
getTokenBefore(org.apache.royale.compiler.common.ISourceLocation sourceLocation)
Returns the token immediately before a source location.
|
org.apache.royale.compiler.parsing.IASToken |
getTokenBefore(org.apache.royale.compiler.common.ISourceLocation sourceLocation,
boolean skipComments,
boolean skipWhitespace)
Returns the token immediately before a source location, with the option
to skip comment and whitespace tokens.
|
org.apache.royale.compiler.parsing.IASToken[] |
getTokens()
Returns all tokens in the file.
|
org.apache.royale.compiler.parsing.IASToken[] |
getTokens(org.apache.royale.compiler.tree.as.IASNode node)
Returns all tokens inside of a particular node.
|
org.apache.royale.compiler.parsing.IASToken[] |
getTokens(org.apache.royale.compiler.tree.as.IASNode node,
boolean skipComments,
boolean skipWhitespace)
Returns all tokens inside of a particular node, with the option to skip
comment and whitespace tokens.
|
org.apache.royale.compiler.parsing.IASToken |
getWhitespaceAfter(org.apache.royale.compiler.common.ISourceLocation after)
Returns the first whitespace that appears after the end of a
particular source location.
|
org.apache.royale.compiler.parsing.IASToken |
getWhitespaceBefore(org.apache.royale.compiler.common.ISourceLocation before)
Returns the first whitespace that appears before the start of a
particular source location.
|
boolean |
isComment(org.apache.royale.compiler.parsing.IASToken token)
Checks if a token is a comment.
|
boolean |
isWhitespace(org.apache.royale.compiler.parsing.IASToken token)
Checks if a token is whitespace.
|
public static final int TOKEN_TYPE_WHITESPACE
public TokenQuery(org.apache.royale.compiler.parsing.IASToken[] tokens)
public org.apache.royale.compiler.parsing.IASToken[] getTokens()
public org.apache.royale.compiler.parsing.IASToken[] getTokens(org.apache.royale.compiler.tree.as.IASNode node)
public org.apache.royale.compiler.parsing.IASToken[] getTokens(org.apache.royale.compiler.tree.as.IASNode node,
boolean skipComments,
boolean skipWhitespace)
public org.apache.royale.compiler.parsing.IASToken getTokenBefore(org.apache.royale.compiler.common.ISourceLocation sourceLocation)
public org.apache.royale.compiler.parsing.IASToken getTokenBefore(org.apache.royale.compiler.common.ISourceLocation sourceLocation,
boolean skipComments,
boolean skipWhitespace)
public org.apache.royale.compiler.parsing.IASToken getTokenAfter(org.apache.royale.compiler.common.ISourceLocation sourceLocation)
public org.apache.royale.compiler.parsing.IASToken getTokenAfter(org.apache.royale.compiler.common.ISourceLocation sourceLocation,
boolean skipComments,
boolean skipWhitespace)
public org.apache.royale.compiler.parsing.IASToken getFirstToken(org.apache.royale.compiler.tree.as.IASNode node)
public org.apache.royale.compiler.parsing.IASToken getFirstToken(org.apache.royale.compiler.tree.as.IASNode node,
boolean skipComments,
boolean skipWhitespace)
public org.apache.royale.compiler.parsing.IASToken getLastToken(org.apache.royale.compiler.tree.as.IASNode node)
public org.apache.royale.compiler.parsing.IASToken getLastToken(org.apache.royale.compiler.tree.as.IASNode node,
boolean skipComments,
boolean skipWhitespace)
public org.apache.royale.compiler.parsing.IASToken getPreviousTokenOfType(org.apache.royale.compiler.common.ISourceLocation before,
int type)
public org.apache.royale.compiler.parsing.IASToken getNextTokenOfType(org.apache.royale.compiler.common.ISourceLocation after,
int type)
public org.apache.royale.compiler.parsing.IASToken[] getCommentsInside(org.apache.royale.compiler.tree.as.IASNode node)
public boolean isComment(org.apache.royale.compiler.parsing.IASToken token)
public org.apache.royale.compiler.parsing.IASToken getCommentBefore(org.apache.royale.compiler.common.ISourceLocation before)
public org.apache.royale.compiler.parsing.IASToken getCommentAfter(org.apache.royale.compiler.common.ISourceLocation after)
public boolean isWhitespace(org.apache.royale.compiler.parsing.IASToken token)
public org.apache.royale.compiler.parsing.IASToken getWhitespaceBefore(org.apache.royale.compiler.common.ISourceLocation before)
public org.apache.royale.compiler.parsing.IASToken getWhitespaceAfter(org.apache.royale.compiler.common.ISourceLocation after)
public org.apache.royale.compiler.parsing.IASToken getSignificantTokenBefore(org.apache.royale.compiler.common.ISourceLocation before)
public org.apache.royale.compiler.parsing.IASToken getSignificantTokenAfter(org.apache.royale.compiler.common.ISourceLocation after)
Copyright © 2023 The Apache Software Foundation. All rights reserved.