fixed the problem of line/column numbers not being in the AST.
This commit is contained in:
parent
bd79d6897e
commit
4ef220d914
|
|
@ -44,6 +44,24 @@ public class DetailAST
|
|||
/** the parent token */
|
||||
private DetailAST mParent;
|
||||
|
||||
/** @see antlr.CommonAST **/
|
||||
public void initialize(Token aTok)
|
||||
{
|
||||
super.initialize(aTok);
|
||||
mLineNo = aTok.getLine();
|
||||
mColumnNo = aTok.getColumn() - 1; // expect columns to start @ 0
|
||||
}
|
||||
|
||||
/** @see antlr.CommonAST **/
|
||||
public void initialize(AST aAST)
|
||||
{
|
||||
final DetailAST da = (DetailAST) aAST;
|
||||
setText(da.getText());
|
||||
setType(da.getType());
|
||||
mLineNo = da.getLineNo();
|
||||
mColumnNo = da.getColumnNo();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of child nodes one level below this node. That is is
|
||||
* does not recurse down the tree.
|
||||
|
|
@ -83,14 +101,6 @@ public class DetailAST
|
|||
return mParent;
|
||||
}
|
||||
|
||||
/** @see antlr.CommonAST **/
|
||||
public void initialize(Token aTok)
|
||||
{
|
||||
super.initialize(aTok);
|
||||
mLineNo = aTok.getLine();
|
||||
mColumnNo = aTok.getColumn() - 1; // expect columns to start @ 0
|
||||
}
|
||||
|
||||
/** @return the line number **/
|
||||
public int getLineNo()
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue