Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Type | Name and description |
---|---|
CSTNode |
add(CSTNode element) Adds an element to the node. |
Reduction |
asReduction() Creates a Reduction from this node. |
CSTNode |
get(int index) Returns the specified element, or null. |
Token |
getRoot() Returns the root of the node, the Token that indicates it's type. |
boolean |
isAnExpression() Returns true if the node is a complete expression. |
boolean |
isEmpty() Returns true if the node is completely empty (no root, even). |
void |
markAsExpression() Marks the node a complete expression. |
static Reduction |
newContainer() Creates a new Reduction with Token.NULL
as it's root. |
CSTNode |
remove(int index) Removes a node from the Reduction . |
CSTNode |
set(int index, CSTNode element) Sets an element in at the specified index. |
int |
size() Returns the number of elements in the node. |
Methods inherited from class | Name |
---|---|
class CSTNode |
add, addChildrenOf, asReduction, canMean, children, get, get, getDescription, getMeaning, getMeaningAs, getRoot, getRoot, getRootText, getStartColumn, getStartLine, getType, hasChildren, isA, isAllOf, isAnExpression, isEmpty, isOneOf, markAsExpression, set, setMeaning, size, toString, write, write |
class Object |
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Initializes the Reduction
with the specified root.
Creates a Reduction
from this node. Returns self if the
node is already a Reduction
.
Returns the specified element, or null.
Returns the root of the node, the Token that indicates it's type. Returns null if there is no root (usually only if the node is a placeholder of some kind -- see isEmpty()).
Returns true if the node is a complete expression.
Returns true if the node is completely empty (no root, even).
Marks the node a complete expression.
Creates a new Reduction
with Token.NULL
as it's root.
Removes a node from the Reduction
. You cannot remove
the root node (index 0).
Returns the number of elements in the node.
Copyright © 2003-2015 The Apache Software Foundation. All rights reserved.