01: /*
02: * JacORB - a free Java ORB
03: *
04: * Copyright (C) 1997-2004 Gerald Brose.
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Library General Public
08: * License as published by the Free Software Foundation; either
09: * version 2 of the License, or (at your option) any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Library General Public License for more details.
15: *
16: * You should have received a copy of the GNU Library General Public
17: * License along with this library; if not, write to the Free
18: * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19: */
20:
21: package org.jacorb.idl;
22:
23: /**
24: * PositionInfo objects are records that group information about the
25: * current position in the input file. They are created by the lexer but
26: * also includes information about the current input stream that is
27: * stored here to make switching between input stream easier for
28: * GlobalInputStream (when including another file or returning to the
29: * including file)
30: *
31: * @author Gerald Brose
32: * @version $Id: PositionInfo.java,v 1.9 2004/05/06 12:39:58 nicolas Exp $
33: */
34:
35: import java.io.File;
36: import java.io.InputStream;
37:
38: public class PositionInfo {
39: public String line = "";
40: public int line_no = 0;
41: public int line_pos = 0;
42: public String pragma_prefix = "";
43: public File file;
44: public InputStream stream;
45:
46: public PositionInfo(int _line_no, int _char_pos, String prefix,
47: String _line, File file) {
48: line_no = _line_no;
49: line_pos = _char_pos;
50: pragma_prefix = prefix;
51: line = _line;
52: this .file = file;
53: }
54:
55: public String toString() {
56: return file.getName() + ", line " + line_no + "(" + line_pos
57: + ")";
58: }
59:
60: }
|