~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to external/nrefactory/ICSharpCode.NRefactory.VB/Lexer/PushParser.frame

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
Import upstream version 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*----------------------------------------------------------------------
 
2
Compiler Generator Coco/R,
 
3
Copyright (c) 1990, 2004 Hanspeter Moessenboeck, University of Linz
 
4
extended by M. Loeberbauer & A. Woess, Univ. of Linz
 
5
with improvements by Pat Terry, Rhodes University
 
6
 
 
7
This program is free software; you can redistribute it and/or modify it 
 
8
under the terms of the GNU General Public License as published by the 
 
9
Free Software Foundation; either version 2, or (at your option) any 
 
10
later version.
 
11
 
 
12
This program is distributed in the hope that it will be useful, but 
 
13
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
 
14
or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
 
15
for more details.
 
16
 
 
17
You should have received a copy of the GNU General Public License along 
 
18
with this program; if not, write to the Free Software Foundation, Inc., 
 
19
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
20
 
 
21
As an exception, it is allowed to write an extension of Coco/R that is
 
22
used as a plugin in non-free software.
 
23
 
 
24
If not otherwise stated, any source code generated by Coco/R (other than 
 
25
Coco/R itself) does not fall under the GNU General Public License.
 
26
----------------------------------------------------------------------*/
 
27
-->begin
 
28
-->namespace
 
29
 
 
30
partial class ExpressionFinder {
 
31
-->constants
 
32
        const bool T = true;
 
33
        const bool x = false;
 
34
 
 
35
-->declarations
 
36
        readonly Stack<int> stateStack = new Stack<int>();
 
37
        bool wasQualifierTokenAtStart = false;
 
38
        bool nextTokenIsPotentialStartOfExpression = false;
 
39
        bool readXmlIdentifier = false;
 
40
        bool identifierExpected = false;
 
41
        bool nextTokenIsStartOfImportsOrAccessExpression = false;
 
42
        bool isMissingModifier = false;
 
43
        bool isAlreadyInExpr = false;
 
44
        bool wasNormalAttribute = false;
 
45
        int lambdaNestingDepth = 0;
 
46
        int activeArgument = 0;
 
47
        List<Token> errors = new List<Token>();
 
48
        
 
49
        public ExpressionFinder()
 
50
        {
 
51
                stateStack.Push(-1); // required so that we don't crash when leaving the root production
 
52
        }
 
53
 
 
54
        void Expect(int expectedKind, Token la)
 
55
        {
 
56
                if (la.kind != expectedKind) {
 
57
                        Error(la);
 
58
                        output.AppendLine("expected: " + expectedKind);
 
59
                        //Console.WriteLine("expected: " + expectedKind);
 
60
                }
 
61
        }
 
62
        
 
63
        void Error(Token la) 
 
64
        {
 
65
                output.AppendLine("not expected: " + la);
 
66
                //Console.WriteLine("not expected: " + la);
 
67
                errors.Add(la);
 
68
        }
 
69
        
 
70
        Token t;
 
71
        
 
72
        public void InformToken(Token la) 
 
73
        {
 
74
                -->informToken
 
75
                if (la != null) {
 
76
                        t = la;
 
77
                        nextTokenIsPotentialStartOfExpression = false;
 
78
                        readXmlIdentifier = false;
 
79
                        nextTokenIsStartOfImportsOrAccessExpression = false;
 
80
                        wasQualifierTokenAtStart = false;
 
81
                        identifierExpected = false;
 
82
                }
 
83
        }
 
84
        
 
85
        public void Advance()
 
86
        {
 
87
                //Console.WriteLine("Advance");
 
88
                InformToken(null);
 
89
        }
 
90
        
 
91
        public BitArray GetExpectedSet() { return GetExpectedSet(currentState); }
 
92
        
 
93
        static readonly BitArray[] set = {
 
94
-->initialization
 
95
        };
 
96
 
 
97
} // end Parser
 
98
 
 
99
 
 
100
$$$
 
 
b'\\ No newline at end of file'