~ubuntu-branches/ubuntu/edgy/monodevelop/edgy

« back to all changes in this revision

Viewing changes to Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/ParserUtil.cs

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2006-09-15 02:15:25 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060915021525-ngsnriip5e3uqi9d
Tags: 0.12-0ubuntu1
* New upstream release
* debian/patches/gtk-sharp-2.10.dpatch,
  debian/patches/versioncontrol_buildfix.dpatch:
  + Dropped, merged upstream
* debian/patches/use_nunit2.2.dpatch,
  debian/patches/firefox.dpatch:
  + Updated

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
namespace ICSharpCode.SharpRefactory.Parser
2
 
{
3
 
        public sealed class ParserUtil
4
 
        {
5
 
                public static bool IsUnaryOperator(Token t)
6
 
                {
7
 
                        return t.kind == Tokens.Plus      || t.kind == Tokens.Minus             ||
8
 
                               t.kind == Tokens.Not       || t.kind == Tokens.BitwiseComplement ||
9
 
                               t.kind == Tokens.Increment || t.kind == Tokens.Decrement         ||
10
 
                               t.kind == Tokens.True      || t.kind == Tokens.False;
11
 
                }
12
 
                
13
 
                public static bool IsBinaryOperator (Token t)
14
 
                {
15
 
                        return t.kind == Tokens.Plus  || t.kind == Tokens.Minus ||
16
 
                               t.kind == Tokens.Times || t.kind == Tokens.Div   ||
17
 
                               t.kind == Tokens.Mod   ||
18
 
                               t.kind == Tokens.BitwiseAnd   || t.kind == Tokens.BitwiseOr  ||
19
 
                               t.kind == Tokens.Xor          ||
20
 
                               t.kind == Tokens.ShiftLeft    || t.kind == Tokens.ShiftRight ||
21
 
                               t.kind == Tokens.Equal        || t.kind == Tokens.NotEqual   ||
22
 
                               t.kind == Tokens.GreaterThan  || t.kind == Tokens.LessThan   ||
23
 
                               t.kind == Tokens.GreaterEqual || t.kind == Tokens.LessEqual;
24
 
                }
25
 
                
26
 
                public static bool IsTypeKW(Token t)
27
 
                {
28
 
                        return t.kind == Tokens.Char    || t.kind == Tokens.Bool   ||
29
 
                               t.kind == Tokens.Object  || t.kind == Tokens.String ||
30
 
                               t.kind == Tokens.Sbyte   || t.kind == Tokens.Byte   ||
31
 
                               t.kind == Tokens.Short   || t.kind == Tokens.Ushort ||
32
 
                               t.kind == Tokens.Int     || t.kind == Tokens.Uint   ||
33
 
                               t.kind == Tokens.Long    || t.kind == Tokens.Ulong  ||
34
 
                               t.kind == Tokens.Float   || t.kind == Tokens.Double ||
35
 
                               t.kind == Tokens.Decimal;
36
 
                }
37
 
        }
38
 
}