/** * Returns the root of the node, the Token that indicates it's * type. Returns a Token.NULL if safe and the actual root is null. */ public Token getRoot( boolean safe ) { Token root = getRoot(); if( root == null && safe ) { root = Token.NULL; } return root; }
/** * Returns the starting column of the node. Returns -1 * if not known. */ public int getStartColumn() { return getRoot(true).getStartColumn(); }
/** * Returns the actual type of the node. If the node isEmpty(), returns * the type of Token.NULL. */ public int getType() { return getRoot( true ).getType(); }
/** * Returns the meaning of this node. If the node isEmpty(), returns * the type of Token.NULL. */ public int getMeaning() { return getRoot( true ).getMeaning(); }
/** * Sets the meaning for this node (and it's root Token). Not * valid if the node isEmpty(). Returns the node, for convenience. */ public CSTNode setMeaning( int meaning ) { getRoot().setMeaning( meaning ); return this; }
/** * Returns the text of the root. Uses <code>getRoot(true)</code> * to get the root, so you will only receive null in return if the * root token returns it. */ public String getRootText() { Token root = getRoot( true ); return root.getText(); }
/** * Returns the starting line of the node. Returns -1 * if not known. */ public int getStartLine() { return getRoot(true).getStartLine(); }
Token root = getRoot( true ); int type = root.getType(); int meaning = root.getMeaning();
/** * Returns the text of the root. Uses <code>getRoot(true)</code> * to get the root, so you will only receive null in return if the * root token returns it. */ public String getRootText() { Token root = getRoot( true ); return root.getText(); }
/** * Returns the meaning of this node. If the node isEmpty(), returns * the type of Token.NULL. */ public int getMeaning() { return getRoot( true ).getMeaning(); }
/** * Returns the starting line of the node. Returns -1 * if not known. */ public int getStartLine() { return getRoot(true).getStartLine(); }
/** * Returns the starting line of the node. Returns -1 * if not known. */ public int getStartLine() { return getRoot(true).getStartLine(); }
/** * Returns the starting column of the node. Returns -1 * if not known. */ public int getStartColumn() { return getRoot(true).getStartColumn(); }
/** * Returns the actual type of the node. If the node isEmpty(), returns * the type of Token.NULL. */ public int getType() { return getRoot( true ).getType(); }
/** * Returns the text of the root. Uses <code>getRoot(true)</code> * to get the root, so you will only receive null in return if the * root token returns it. */ public String getRootText() { Token root = getRoot( true ); return root.getText(); }
/** * Returns the starting column of the node. Returns -1 * if not known. */ public int getStartColumn() { return getRoot(true).getStartColumn(); }
/** * Returns the starting line of the node. Returns -1 * if not known. */ public int getStartLine() { return getRoot(true).getStartLine(); }
/** * Returns the starting line of the node. Returns -1 * if not known. */ public int getStartLine() { return getRoot(true).getStartLine(); }
/** * Sets the meaning for this node (and it's root Token). Not * valid if the node isEmpty(). Returns the node, for convenience. */ public CSTNode setMeaning( int meaning ) { getRoot().setMeaning( meaning ); return this; }
/** * Sets the meaning for this node (and it's root Token). Not * valid if the node isEmpty(). Returns the node, for convenience. */ public CSTNode setMeaning( int meaning ) { getRoot().setMeaning( meaning ); return this; }