wasCSharpSQLite – Blame information for rev
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | /* |
2 | * ParseResult.java |
||
3 | * |
||
4 | * Copyright (c) 1997 Cornell University. |
||
5 | * Copyright (c) 1997 Sun Microsystems, Inc. |
||
6 | * |
||
7 | * See the file "license.terms" for information on usage and |
||
8 | * redistribution of this file, and for a DISCLAIMER OF ALL |
||
9 | * WARRANTIES. |
||
10 | * |
||
11 | * Included in SQLite3 port to C# for use in testharness only; 2008 Noah B Hart |
||
12 | * |
||
13 | * RCS @(#) $Id: ParseResult.java,v 1.3 2003/01/09 02:15:39 mdejong Exp $ |
||
14 | * |
||
15 | */ |
||
16 | using System.Text; |
||
17 | namespace tcl.lang |
||
18 | { |
||
19 | |||
20 | /// <summary> This class stores a single word that's generated inside the Tcl parser |
||
21 | /// inside the Interp class. |
||
22 | /// </summary> |
||
23 | public class ParseResult |
||
24 | { |
||
25 | |||
26 | /// <summary> The value of a parse operation. For calls to Interp.intEval(), |
||
27 | /// this variable is the same as interp.m_result. The ref count |
||
28 | /// has been incremented, so the user will need to explicitly |
||
29 | /// invoke release() to drop the ref. |
||
30 | /// </summary> |
||
31 | public TclObject value; |
||
32 | |||
33 | /// <summary> Points to the next character to be parsed.</summary> |
||
34 | public int nextIndex; |
||
35 | |||
36 | /// <summary> Create an empty parsed word.</summary> |
||
37 | internal ParseResult() |
||
38 | { |
||
39 | value = TclString.newInstance( "" ); |
||
40 | value.preserve(); |
||
41 | } |
||
42 | |||
43 | internal ParseResult( string s, int ni ) |
||
44 | { |
||
45 | value = TclString.newInstance( s ); |
||
46 | value.preserve(); |
||
47 | nextIndex = ni; |
||
48 | } |
||
49 | |||
50 | /// <summary> Assume that the caller has already preserve()'ed the TclObject.</summary> |
||
51 | internal ParseResult( TclObject o, int ni ) |
||
52 | { |
||
53 | value = o; |
||
54 | nextIndex = ni; |
||
55 | } |
||
56 | |||
57 | internal ParseResult( StringBuilder sbuf, int ni ) |
||
58 | { |
||
59 | value = TclString.newInstance( sbuf.ToString() ); |
||
60 | value.preserve(); |
||
61 | nextIndex = ni; |
||
62 | } |
||
63 | |||
64 | public void release() |
||
65 | { |
||
66 | value.release(); |
||
67 | } |
||
68 | } |
||
69 | } |