public int Compare(Object x, Object y) { SqlShParserLocation lx = (SqlShParserLocation)x; SqlShParserLocation ly = (SqlShParserLocation)y; if ((lx.LineNr == ly.LineNr) && (lx.Statement != null && ly.Statement != null)) { if (lx.Statement.Type == ly.Statement.Type) { return(lx.Position.CompareTo(ly.Position)); } else if (lx.Statement.Type == SqlShParserStatmentType.Select && ly.Statement.Type == SqlShParserStatmentType.Case) { return(1); } else if (ly.Statement.Type == SqlShParserStatmentType.Select && lx.Statement.Type == SqlShParserStatmentType.Case) { return(-1); } else { return(lx.Position.CompareTo(ly.Position)); } } else { return(lx.Position.CompareTo(ly.Position)); } }
public void PushEndLocation(Location end, int offsetCorrection) { SqlShParserLocation loc = SqlShParserLocation.CreateCopyFromParserLocation(end, offsetCorrection); loc.Statement = this; PushEndLocation(loc); }
public int Compare(Object x, Object y) { SqlShParserLocation lx = (SqlShParserLocation)x; SqlShParserLocation ly = (SqlShParserLocation)y; return(lx.Position.CompareTo(ly.Position)); }
public void PushStartLocation(Location start, int offsetCorrection) { SqlShParserLocation loc = SqlShParserLocation.CreateCopyFromParserLocation(start, offsetCorrection); loc.Statement = this; PushStartLocation(loc); }
private void PushStartLocation(SqlShParserLocation start) { _locationStarts.Push(start); if (_locationStarts.Count == 1) { TopMostStartLocation = start; } }
public static SqlShParserLocation CreateCopyFromParserLocation(Location source, int offsetCorrection) { SqlShParserLocation result = new SqlShParserLocation(); result.LineNr = source.LineNr; result.ColumnNr = source.ColumnNr; result.Position = source.Position + offsetCorrection; return(result); }
private void PushEndLocation(SqlShParserLocation end) { if (_locationStarts.Count == 0) { return; } SqlShParserLocation start = _locationStarts.Pop(); AddBoundary(start, end); }
public void AddBoundary(SqlShParserLocation start, SqlShParserLocation end) { SqlShBoundary b = new SqlShBoundary(start, end); _boundaries.Add(b); if (_startLocationStorage != null) { _startLocationStorage.Add(start); } }
public SqlShBoundary(SqlShParserLocation start, SqlShParserLocation end) { _startOffset = start.Position; _endOffset = end.Position; _startLine = start.LineNr; _endLine = end.LineNr; _startCol = start.ColumnNr; _endCol = end.ColumnNr; start.Boundary = this; end.Boundary = this; }
public static SqlShParserLocation CreateCopyFromParserLocation(Location source) { return(SqlShParserLocation.CreateCopyFromParserLocation(source, 0)); }
public SqlStatement(ArrayList startLocationStorage, SqlShParserStatmentType type) { _type = type; _startLocationStorage = startLocationStorage; TopMostStartLocation = SqlShParserLocation.NullParserLocation(); }