private IParseTree returnStatementOrExpression( IParseTree statement ) { if( statement != null ) { return statement; } if( _parser.getLocations().size() == 1 && _parser.getLocations().get( 0 ).getParsedElement() instanceof IExpression ) { return _parser.getLocations().get( 0 ); } return null; }
IParseTree getDeepestLocation( int iPos, boolean strict ) { if( _parser == null ) { return null; } else { List<IParseTree> locations = _parser.getLocations(); return IParseTree.Search.getDeepestLocation( locations, iPos - _parser.getOffsetShift(), strict ); } }
public IParseTree getDeepestStatementLocationAtPos( int iPos ) { List<IParseTree> locations = _parser.getLocations(); return IParseTree.Search.getDeepestStatementLocation( locations, iPos - _parser.getOffsetShift(), false ); }
IParseTree getDeepestLocation( int iPos, boolean strict ) { if( _parser == null ) { return null; } else { List<IParseTree> locations = _parser.getLocations(); return IParseTree.Search.getDeepestLocation( locations, iPos - _parser.getOffsetShift(), strict ); } }
public IParseTree getDeepestStatementLocationAtPos( int iPos ) { List<IParseTree> locations = _parser.getLocations(); return IParseTree.Search.getDeepestStatementLocation( locations, iPos - _parser.getOffsetShift(), false ); }
public IParseTree getDeepestStatementLocationAtPos( int iPos, boolean bStrict ) { if( _parser == null ) { return null; } else { List<IParseTree> locations = _parser.getLocations(); return IParseTree.Search.getDeepestStatementLocation( locations, iPos - _parser.getOffsetShift(), bStrict ); } }
@Override public IParseTree getStatementAtLine( int iLineNum ) { if( _parser != null ) { List<IParseTree> locations = _parser.getLocations(); return IParseTree.Search.getStatementAtLine( locations, iLineNum - _parser.getLineNumShift(), IStatementList.class ); } return null; }
@Override public IParseTree getStatementAtLine( int iLineNum ) { if( _parser != null ) { List<IParseTree> locations = _parser.getLocations(); return IParseTree.Search.getStatementAtLine( locations, iLineNum - _parser.getLineNumShift(), IStatementList.class ); } return null; }
public IParseTree getDeepestStatementLocationAtPos( int iPos, boolean bStrict ) { if( _parser == null ) { return null; } else { List<IParseTree> locations = _parser.getLocations(); return IParseTree.Search.getDeepestStatementLocation( locations, iPos - _parser.getOffsetShift(), bStrict ); } }
private int findPackageLocation() { List<IParseTree> locations = _gsEditor.getParser().getLocations(); List<INamespaceStatement> listOut = new ArrayList<INamespaceStatement>(); IParseTree.Search.getContainedParsedElementsByType( locations, INamespaceStatement.class, listOut ); if( listOut.size() > 0 ) { return listOut.get( 0 ).getLocation().getOffset(); } return -1; }
private int findPackageLocation() { List<IParseTree> locations = _gsEditor.getParser().getLocations(); List<INamespaceStatement> listOut = new ArrayList<INamespaceStatement>(); IParseTree.Search.getContainedParsedElementsByType( locations, INamespaceStatement.class, listOut ); if( listOut.size() > 0 ) { return listOut.get( 0 ).getLocation().getOffset(); } return -1; }
private int findClasspathLocation() { List<IParseTree> locations = _gsEditor.getParser().getLocations(); List<IClasspathStatement> listOut = new ArrayList<IClasspathStatement>(); IParseTree.Search.getContainedParsedElementsByType( locations, IClasspathStatement.class, listOut ); if( listOut.size() > 0 ) { return listOut.get( 0 ).getLocation().getOffset(); } return -1; }
private int findClasspathLocation() { List<IParseTree> locations = _gsEditor.getParser().getLocations(); List<IClasspathStatement> listOut = new ArrayList<IClasspathStatement>(); IParseTree.Search.getContainedParsedElementsByType( locations, IClasspathStatement.class, listOut ); if( listOut.size() > 0 ) { return listOut.get( 0 ).getLocation().getOffset(); } return -1; }
IExpression getExpressionAtPos( int iPos ) { IParseTree locationBeforeDot = IParseTree.Search.getDeepestLocation( _parser.getLocations(), iPos - _parser.getOffsetShift(), true ); if( locationBeforeDot != null ) { IParsedElement pe = locationBeforeDot.getParsedElement(); if( pe instanceof IExpression ) { return (IExpression)pe; } } return null; }
IParseTree getDeepestLocationSpanning( int start, int end ) { if( _parser == null ) { return null; } else { List<IParseTree> locations = _parser.getLocations(); return IParseTree.Search.getDeepestLocationSpanning( locations, start - _parser.getOffsetShift(), end - _parser.getOffsetShift(), true ); } }
IParseTree getDeepestLocationSpanning( int start, int end ) { if( _parser == null ) { return null; } else { List<IParseTree> locations = _parser.getLocations(); return IParseTree.Search.getDeepestLocationSpanning( locations, start - _parser.getOffsetShift(), end - _parser.getOffsetShift(), true ); } }
IExpression getExpressionAtPos( int iPos ) { IParseTree locationBeforeDot = IParseTree.Search.getDeepestLocation( _parser.getLocations(), iPos - _parser.getOffsetShift(), true ); if( locationBeforeDot != null ) { IParsedElement pe = locationBeforeDot.getParsedElement(); if( pe instanceof IExpression ) { return (IExpression)pe; } } return null; }
int getPositionAtStartOfExpressionAtCaret() { IParseTree locationBeforeDot = IParseTree.Search.getDeepestLocation( _parser.getLocations(), _editor.getCaretPosition() - _parser.getOffsetShift(), true ); return locationBeforeDot.getOffset(); }
int getPositionAtStartOfExpressionAtCaret() { IParseTree locationBeforeDot = IParseTree.Search.getDeepestLocation( _parser.getLocations(), _editor.getCaretPosition() - _parser.getOffsetShift(), true ); return locationBeforeDot.getOffset(); }
public IExpression getExpressionContainingCharacterBeforeCaret() { int iPos = _editor.getCaretPosition() - _parser.getOffsetShift(); IParseTree locationBeforeDot = IParseTree.Search.getDeepestLocation( _parser.getLocations(), iPos - 1, iPos, true ); if( locationBeforeDot != null ) { IParsedElement pe = locationBeforeDot.getParsedElement(); if( pe instanceof IExpression ) { return (IExpression)pe; } } return null; }