.NET CIL Browser - CilBrowser.Core

Type: CilBrowser.Core.SyntaxModel.PowerShell.PsTokenFactory

Types in CilBrowser.Core.SyntaxModel.PowerShell namespace:

PsCommentToken

PsMultilineCommentToken

PsSyntaxProvider

PsTextLiteralToken

PsTokenFactory

.class public auto ansi sealed beforefieldinit CilBrowser.Core.SyntaxModel.PowerShell.PsTokenFactory
extends [CilTools.BytecodeAnalysis]CilTools.Syntax.SyntaxFactory
{

 .field private static initonly class [netstandard]System.Collections.Generic.HashSet`1<string> keywords
 .field public static initonly class CilBrowser.Core.SyntaxModel.PowerShell.PsTokenFactory Value

 .method private hidebysig specialname rtspecialname instance void .ctor() cil managed
 {
  .maxstack  8

           ldarg.0      
           call         instance void [CilTools.BytecodeAnalysis]CilTools.Syntax.SyntaxFactory::.ctor()
           nop          
           nop          
           ret          
 }

 .method private hidebysig specialname rtspecialname static void .cctor() cil managed
 {
  .maxstack  4

           ldc.i4.s     35
           newarr       [netstandard]System.String
           dup          
           ldc.i4.0     
           ldstr        "begin"
           stelem.ref   
           dup          
           ldc.i4.1     
           ldstr        "break"
           stelem.ref   
           dup          
           ldc.i4.2     
           ldstr        "catch"
           stelem.ref   
           dup          
           ldc.i4.3     
           ldstr        "class"
           stelem.ref   
           dup          
           ldc.i4.4     
           ldstr        "continue"
           stelem.ref   
           dup          
           ldc.i4.5     
           ldstr        "data"
           stelem.ref   
           dup          
           ldc.i4.6     
           ldstr        "define"
           stelem.ref   
           dup          
           ldc.i4.7     
           ldstr        "do"
           stelem.ref   
           dup          
           ldc.i4.8     
           ldstr        "dynamicparam"
           stelem.ref   
           dup          
           ldc.i4.s     9
           ldstr        "else"
           stelem.ref   
           dup          
           ldc.i4.s     10
           ldstr        "elseif"
           stelem.ref   
           dup          
           ldc.i4.s     11
           ldstr        "end"
           stelem.ref   
           dup          
           ldc.i4.s     12
           ldstr        "enum"
           stelem.ref   
           dup          
           ldc.i4.s     13
           ldstr        "exit"
           stelem.ref   
           dup          
           ldc.i4.s     14
           ldstr        "filter"
           stelem.ref   
           dup          
           ldc.i4.s     15
           ldstr        "finally"
           stelem.ref   
           dup          
           ldc.i4.s     16
           ldstr        "for"
           stelem.ref   
           dup          
           ldc.i4.s     17
           ldstr        "foreach"
           stelem.ref   
           dup          
           ldc.i4.s     18
           ldstr        "from"
           stelem.ref   
           dup          
           ldc.i4.s     19
           ldstr        "function"
           stelem.ref   
           dup          
           ldc.i4.s     20
           ldstr        "hidden"
           stelem.ref   
           dup          
           ldc.i4.s     21
           ldstr        "if"
           stelem.ref   
           dup          
           ldc.i4.s     22
           ldstr        "in"
           stelem.ref   
           dup          
           ldc.i4.s     23
           ldstr        "param"
           stelem.ref   
           dup          
           ldc.i4.s     24
           ldstr        "process"
           stelem.ref   
           dup          
           ldc.i4.s     25
           ldstr        "return"
           stelem.ref   
           dup          
           ldc.i4.s     26
           ldstr        "static"
           stelem.ref   
           dup          
           ldc.i4.s     27
           ldstr        "switch"
           stelem.ref   
           dup          
           ldc.i4.s     28
           ldstr        "throw"
           stelem.ref   
           dup          
           ldc.i4.s     29
           ldstr        "trap"
           stelem.ref   
           dup          
           ldc.i4.s     30
           ldstr        "try"
           stelem.ref   
           dup          
           ldc.i4.s     31
           ldstr        "until"
           stelem.ref   
           dup          
           ldc.i4.s     32
           ldstr        "using"
           stelem.ref   
           dup          
           ldc.i4.s     33
           ldstr        "var"
           stelem.ref   
           dup          
           ldc.i4.s     34
           ldstr        "while"
           stelem.ref   
           call         class [netstandard]System.StringComparer [netstandard]System.StringComparer::get_OrdinalIgnoreCase()
           newobj       instance void class [netstandard]System.Collections.Generic.HashSet`1<string>::.ctor(class [netstandard]System.Collections.Generic.IEnumerable`1<!0>, class [netstandard]System.Collections.Generic.IEqualityComparer`1<!0>)
           stsfld       class [netstandard]System.Collections.Generic.HashSet`1<string> CilBrowser.Core.SyntaxModel.PowerShell.PsTokenFactory::keywords
           newobj       instance void CilBrowser.Core.SyntaxModel.PowerShell.PsTokenFactory::.ctor()
           stsfld       class CilBrowser.Core.SyntaxModel.PowerShell.PsTokenFactory CilBrowser.Core.SyntaxModel.PowerShell.PsTokenFactory::Value
           ret          
 }

 .method private hidebysig static valuetype [CilTools.SourceCode]CilTools.SourceCode.Common.TokenKind GetKind(
     string token
 ) cil managed
 {
  .maxstack  3
  .locals  init (bool V_0,
     valuetype [CilTools.SourceCode]CilTools.SourceCode.Common.TokenKind V_1,
     bool V_2,
     bool V_3,
     bool V_4,
     bool V_5,
     bool V_6,
     bool V_7,
     bool V_8,
     bool V_9)

           nop          
           ldarg.0      
           callvirt     instance int32 [netstandard]System.String::get_Length()
           ldc.i4.0     
           ceq          
           stloc.0      
           ldloc.0      
           brfalse.s    IL_0001
           ldc.i4.0     
           stloc.1      
           br           IL_0014
  IL_0001: ldsfld       class [netstandard]System.Collections.Generic.HashSet`1<string> CilBrowser.Core.SyntaxModel.PowerShell.PsTokenFactory::keywords
           ldarg.0      
           callvirt     instance bool class [netstandard]System.Collections.Generic.HashSet`1<string>::Contains(!0)
           stloc.2      
           ldloc.2      
           brfalse.s    IL_0002
           nop          
           ldc.i4.4     
           stloc.1      
           br           IL_0014
  IL_0002: ldarg.0      
           ldc.i4.0     
           callvirt     instance char [netstandard]System.String::get_Chars(int32)
           call         bool [netstandard]System.Char::IsLetter(char)
           brtrue.s     IL_0003
           ldarg.0      
           ldc.i4.0     
           callvirt     instance char [netstandard]System.String::get_Chars(int32)
           ldc.i4.s     95
           ceq          
           br.s         IL_0004
  IL_0003: ldc.i4.1     
  IL_0004: stloc.3      
           ldloc.3      
           brfalse.s    IL_0005
           nop          
           ldc.i4.1     
           stloc.1      
           br           IL_0014
  IL_0005: ldarg.0      
           ldc.i4.0     
           callvirt     instance char [netstandard]System.String::get_Chars(int32)
           ldc.i4.s     35
           ceq          
           stloc.s      V_4
           ldloc.s      V_4
           brfalse.s    IL_0006
           nop          
           ldc.i4.s     10
           stloc.1      
           br           IL_0014
  IL_0006: ldarg.0      
           ldstr        "<#"
           ldc.i4.4     
           callvirt     instance bool [netstandard]System.String::StartsWith(string, valuetype [netstandard]System.StringComparison)
           stloc.s      V_5
           ldloc.s      V_5
           brfalse.s    IL_0007
           nop          
           ldc.i4.s     11
           stloc.1      
           br.s         IL_0014
  IL_0007: ldarg.0      
           ldc.i4.0     
           callvirt     instance char [netstandard]System.String::get_Chars(int32)
           ldc.i4.s     39
           ceq          
           stloc.s      V_6
           ldloc.s      V_6
           brfalse.s    IL_0008
           nop          
           ldc.i4.6     
           stloc.1      
           br.s         IL_0014
  IL_0008: ldarg.0      
           ldc.i4.0     
           callvirt     instance char [netstandard]System.String::get_Chars(int32)
           ldc.i4.s     34
           ceq          
           stloc.s      V_7
           ldloc.s      V_7
           brfalse.s    IL_0009
           nop          
           ldc.i4.7     
           stloc.1      
           br.s         IL_0014
  IL_0009: ldarg.0      
           ldc.i4.0     
           callvirt     instance char [netstandard]System.String::get_Chars(int32)
           call         bool [netstandard]System.Char::IsPunctuation(char)
           brtrue.s     IL_0010
           ldarg.0      
           ldc.i4.0     
           callvirt     instance char [netstandard]System.String::get_Chars(int32)
           call         bool [netstandard]System.Char::IsSymbol(char)
           br.s         IL_0011
  IL_0010: ldc.i4.1     
  IL_0011: stloc.s      V_8
           ldloc.s      V_8
           brfalse.s    IL_0012
           nop          
           ldc.i4.5     
           stloc.1      
           br.s         IL_0014
  IL_0012: ldarg.0      
           ldc.i4.0     
           callvirt     instance char [netstandard]System.String::get_Chars(int32)
           call         bool [netstandard]System.Char::IsDigit(char)
           stloc.s      V_9
           ldloc.s      V_9
           brfalse.s    IL_0013
           nop          
           ldc.i4.s     9
           stloc.1      
           br.s         IL_0014
  IL_0013: nop          
           ldc.i4.0     
           stloc.1      
           br.s         IL_0014
  IL_0014: ldloc.1      
           ret          
 }

 .method public hidebysig virtual instance class [CilTools.BytecodeAnalysis]CilTools.Syntax.SyntaxNode CreateNode(
     string content, 
     string leadingWhitespace, 
     string trailingWhitespace
 ) cil managed
 {
  .maxstack  4
  .locals  init (valuetype [CilTools.SourceCode]CilTools.SourceCode.Common.TokenKind V_0,
     class [CilTools.BytecodeAnalysis]CilTools.Syntax.SyntaxNode V_1)

           nop          
           ldarg.1      
           call         valuetype [CilTools.SourceCode]CilTools.SourceCode.Common.TokenKind CilBrowser.Core.SyntaxModel.PowerShell.PsTokenFactory::GetKind(string)
           stloc.0      
           ldarg.1      
           ldloc.0      
           ldarg.2      
           ldarg.3      
           newobj       instance void [CilTools.SourceCode]CilTools.SourceCode.Common.SourceToken::.ctor(string, valuetype [CilTools.SourceCode]CilTools.SourceCode.Common.TokenKind, string, string)
           stloc.1      
           br.s         IL_0001
  IL_0001: ldloc.1      
           ret          
 }

}

Back to table of contents


Generated by CIL Browser