KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > idl > PositionInfo


1 /*
2  * JacORB - a free Java ORB
3  *
4  * Copyright (C) 1997-2004 Gerald Brose.
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * 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 JavaDoc;
36 import java.io.InputStream JavaDoc;
37
38 public class PositionInfo
39 {
40     public String JavaDoc line = "";
41     public int line_no = 0;
42     public int line_pos = 0;
43     public String JavaDoc pragma_prefix = "";
44     public File JavaDoc file;
45     public InputStream JavaDoc stream;
46
47     public PositionInfo( int _line_no,
48                          int _char_pos,
49                          String JavaDoc prefix,
50                          String JavaDoc _line,
51                          File JavaDoc file)
52     {
53         line_no = _line_no;
54         line_pos = _char_pos;
55         pragma_prefix = prefix;
56         line = _line;
57         this.file = file;
58     }
59
60     public String JavaDoc toString()
61     {
62         return file.getName() + ", line " + line_no + "(" + line_pos + ")";
63     }
64
65 }
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Popular Tags