public SourceContext(SourceContext left, SourceContext right) { if (left != null) { _begin_position = new file_position(left.begin_position.line_num, left.begin_position.column_num); } if (right != null) { _end_position = new file_position(right.end_position.line_num, right.end_position.column_num); } if (left == null) { _begin_position = _end_position; } if (right == null) { _end_position = _begin_position; } if (left != null) { this._begin_symbol_position = left._begin_symbol_position; } if (right != null) { this._end_symbol_position = right._end_symbol_position; } if (left != null && right != null) { this.FileName = left.FileName == right.FileName ? left.FileName : null; } }
public SourceContext(int beg_line_num, int beg_column_num, int end_line_num, int end_column_num, int _begin_symbol_position, int _end_symbol_position) { _begin_position = new file_position(beg_line_num, beg_column_num); _end_position = new file_position(end_line_num, end_column_num); this._begin_symbol_position = _begin_symbol_position; this._end_symbol_position = _end_symbol_position; }
public SourceContext(int beg_line_num, int beg_column_num, int end_line_num, int end_column_num, string filename = null) { _begin_position = new file_position(beg_line_num, beg_column_num); _end_position = new file_position(end_line_num, end_column_num); this._begin_symbol_position = 0; this._end_symbol_position = 0; _file_name = filename; }
public SourceContext(SourceContext sc) { if (sc == null) { throw new ArgumentNullException(nameof(sc)); } if (sc._begin_position != null) { _begin_position = new file_position(sc._begin_position.line_num, sc._begin_position.column_num); } if (sc._end_position != null) { _end_position = new file_position(sc._end_position.line_num, sc.end_position.column_num); } _begin_symbol_position = sc._begin_symbol_position; _end_symbol_position = sc._end_symbol_position; _file_name = sc._file_name; }