Eagle Legacy Modernization, LLC

Powershell Grammar

Main program: Powershell_Program

Powershell syntax:

 Count  Terminals:
1,235 Powershell_Comment: /* comment */ or # or // comment to end of line
70 Powershell_Field_Reference: An identifier
611 Powershell_Filename: file name
141 Powershell_Function_Definition: An identifier
5,925 Powershell_Function_Reference: An identifier
302 Powershell_Identifier_Reference: An identifier
7,039 Powershell_Literal: Literal quotes:"' escape:` doubled:yes multiline:no
4,616 Powershell_Number: Number exponent_chars:Ee suffix_chars:none trailing_period:yes ignore_char:none
12,647 Powershell_RealEndOfLine: End of line
8,603 Powershell_Variable_Reference: An identifier
585 Powershell_VerbNoun: An identifier
142 Powershell_Word: generic word
 Count  Statistics(*) Tokens:
168 all 2.37(all) Powershell_GetChildItem: ("Get-ChildItem"|"GCI") [Powershell_GCIparam]*
417 (3% | 23% | 6% | 18% | 49% | 1% | 0%) |   Powershell_GCIparam: (Powershell_GCExclude | Powershell_Literal | Powershell_Filename | Powershell_Variable | ("-Directory"|"-File"|"-Filter"|"-Force"|"-Hidden"|"-Path"|"-Recurse") | Powershell_StandardOption | Powershell_Word)
14 all 1.71 |   |   Powershell_GCExclude: ("-Exclude"|"-Include") Powershell_GCIparam*
37 all all Powershell_GetContent: "Get-Content" Powershell_GCParam
37 (none | 73% | 27%) |   Powershell_GCParam: (Power_GCEncoding | Powershell_Literal | Powershell_Filename)
    |   |   Power_GCEncoding: "-Encoding" ("Byte"|"UTF8")
4 (all) Powershell_StandardOption: (Powershell_ErrorAction)
4 all all |   Powershell_ErrorAction: "-ErrorAction" ("Ignore"|"SilentlyContinue")
132 all all Powershell_TestPath: "Test-Path" Powershell_TPParam
132 (36% | 64%) |   Powershell_TPParam: (Powershell_Literal | Powershell_Filename)
1,139 all all 1% all Powershell_Additive_Expression: Powershell_Expression ("+"|"-") [Powershell_RealEndOfLine] Powershell_Expression
1 all all Powershell_AmpersandOperator: '&' Powershell_Command
2,906 all all all Powershell_AssignmentExpression: Powershell_Expression ("="|"*="|"/="|"%="|"+="|"-=") Powershell_Expression
4 all all Powershell_BangOperator: '!' Powershell_Expression
326 all Powershell_BuiltIn: ("$False"|"$True")
321 all Powershell_BuiltinVariable: ("$?"|"$_")
148 all all all all Powershell_Cast: '[' Powershell_Type ']' Powershell_Expression
76 all all 17% all Powershell_Dictionary: ['@'] '{' [Powershell_DictionaryValues] '}'
13 all all all all 4.69(all) none all |   Powershell_DictionaryValues: [Powershell_EndOfLine] Powershell_Field '=' Powershell_Expression [Powershell_MoreDictExpressions]* [Powershell_Comment] [Powershell_EndOfLine]
74 (95% | 5%) |   |   Powershell_Field: (Powershell_Field_Reference | Powershell_Literal)
61 97% none all all all all |   |   Powershell_MoreDictExpressions: [';'] [Powershell_Comment] [Powershell_EndOfLine] Powershell_Field '=' Powershell_Expression
19 all all all all Powershell_EvaluateExpression: '$' '(' Powershell_Expression ')'
3,729 0% 3% all 1.21(65%) Powershell_FunctionCall: [Powershell_DiscardResult] [Powershell_Library] Powershell_Function_Reference [Powershell_FunctionArg]*
15 all all all |   Powershell_DiscardResult: '[' "void" ']'
2,916 all 11% |   Powershell_FunctionArg: Powershell_Expression [',']
    Powershell_IsExpression: Powershell_Expression "-is" '[' Powershell_Type ']'
    Powershell_LibraryVariable: Powershell_Library Powershell_Identifier_Reference
469 all all all all Powershell_List: ['@'] '(' [Powershell_ExpressionList] ')'
78 all all 21% all Powershell_LogicalAnd_Expression: Powershell_Expression "-and" [Powershell_RealEndOfLine] Powershell_Expression
330 all all Powershell_LogicalNotOperator: "-not" Powershell_Expression
68 all all 4% all Powershell_LogicalOr_Expression: Powershell_Expression "-or" [Powershell_RealEndOfLine] Powershell_Expression
100 all all all Powershell_Match_Expression: Powershell_Expression ("-cmatch"|"-cnotmatch"|"-contains"|"-f"|"-in"|"-join"|"-match"|"-notin"|"-notlike"|"-notmatch"|"-replace"|"-split") Powershell_ExpressionList
183 all all none all Powershell_Multiplicative_Expression: Powershell_Expression ("*"|"/"|"%") [Powershell_RealEndOfLine] Powershell_Expression
534 all all Powershell_Negative: ("-") Powershell_Expression
1,181 all all Powershell_ParenthesizedExpression: '(' Powershell_ParenWhat
1,171 all all |   Powershell_ParenExpression: Powershell_Expression ')'
10 all all |   Powershell_ParenStatement: Powershell_Element ')'
1,181 (99% | 1%) |   Powershell_ParenWhat: (Powershell_ParenExpression | Powershell_ParenStatement)
376 all all 14% all Powershell_PipeExpression: Powershell_Expression '|' [Powershell_RealEndOfLine] Powershell_Statement
299 all all Powershell_PostIncrementExpression: Powershell_Variable ("++"|"--")
    Powershell_PreIncrementExpression: ("++"|"--") Powershell_Variable
2 all all all Powershell_RangeExpression: Powershell_Expression ".." Powershell_Expression
576 all all all Powershell_Relational_Expression: Powershell_Expression ("-ceq"|"-cne"|"-eq"|"-ge"|"-gt"|"-ieq"|"-ine"|"-le"|"-lt"|"-ne") Powershell_Expression
1,577 all all all Powershell_SubfieldExpression: Powershell_Expression '.' Powershell_Expression
62 all all all all Powershell_SubscriptExpression: Powershell_Expression '[' Powershell_Expression ']'
7,555 all Powershell_VariableExpression: Powershell_Variable
    Powershell_FloorFunction: Powershell_Library "Floor" '(' Powershell_Expression ')'
1 all all all all all Powershell_TruncateFunction: Powershell_Library "Truncate" '(' Powershell_Expression ')'
53 all all all Powershell_LengthMethod: Powershell_Expression '.' "length"
50 all all all all all all Powershell_StartsWithMethod: Powershell_Expression '.' "startswith" '(' Powershell_Expression ')'
122 all all all all all 66% all Powershell_SubStringMethod: Powershell_Expression '.' "substring" '(' Powershell_Expression [Powershell_SubStringNC] ')'
81 all all |   Powershell_SubStringNC: ',' Powershell_Expression
142 all all all all all all Powershell_CmdletBinding: '[' "CmdletBinding" '(' ')' ']' [Powershell_EndOfLine]
156 all all Powershell_CommentEoln: Powershell_Comment [Powershell_EndOfLine]
2 all 1.00 all none all all Powershell_Directive: '[' Powershell_WhichDirective* ']' [Powershell_DirectiveRedirect] [Powershell_Comment] Powershell_RealEndOfLine
    |   Powershell_DirectiveRedirect: '|' "Out-Null"
2 (none | all | none | none | none | none) |   Powershell_WhichDirective: (Powershell_ContentTypeDirective | Powershell_DiagnosticsDirective | Powershell_WindowsDirective1 | Powershell_WindowsDirective2 | Powershell_WindowsDirective3 | Powershell_WindowsDirective4)
    |   |   Powershell_ContentTypeDirective: "ContentType" '=' "WindowsRuntime"
2 all all all all all all all all all all |   |   Powershell_DiagnosticsDirective: "Diagnostics" '.' "CodeAnalysis" '.' "SuppressMessageAttribute" '(' Powershell_Literal ',' Powershell_Literal ')'
    |   |   Powershell_WindowsDirective1: "Windows" '.' "Storage" '.' "StorageFile"
    |   |   Powershell_WindowsDirective2: "Windows" '.' "Graphics" '.' "Imaging" '.' "BitmapDecoder"
    |   |   Powershell_WindowsDirective3: "Windows" '.' "Storage"
    |   |   Powershell_WindowsDirective4: "Windows" '.' "Graphics"
10,531 all 2% 100% Powershell_Element: Powershell_Statement [Powershell_Comment] [Powershell_EndOfLine]
10,907 (none | 0% | 8% | 1% | none | 0% | 1% | 10% | 4% | 0% | 1% | none | 1% | 0% | 0% | 0% | 1% | 0% | 10% | 0% | 0% | 0% | 30% | 33%) |   Powershell_Statement: (Powershell_BeginBlock | Powershell_BreakStatement | Powershell_Comment | Powershell_ContinueStatement | Powershell_Directive | Powershell_DoStatement | Powershell_ExitStatement | Powershell_IfStatement | Powershell_ForEachStatement | Powershell_ForStatement | Powershell_Function | Powershell_ProcessBlock | Powershell_ReturnStatement | Powershell_StartJob | Powershell_SwitchStatement | Powershell_ThrowStatement | Powershell_TryStatement | Powershell_WhereStatement | Powershell_WriteStatement | Powershell_WhileStatement | CMD_Xcopy_Statement | CMD_FindStr_Statement | Powershell_Command | Powershell_ExpressionStatement)
18,680 1.00(0%) 1% 67% Powershell_EndOfLine: [Powershell_Redirect]* [Powershell_Pipe] [Powershell_RealEndOfLine]
176 (98% | 2%) |   Powershell_Pipe: (Powershell_PipeAction | Powershell_PipeBogusSemicolon)
173 all 46% all |   |   Powershell_PipeAction: ("|"|";"|"||"|"&&") [Powershell_RealEndOfLine] Powershell_Element
3 all all |   |   Powershell_PipeBogusSemicolon: ';' Powershell_RealEndOfLine
12 all all |   Powershell_Redirect: ("<"|">"|">>"|"&>"|"1>"|"2>"|"*>") Powershell_RedirectTo
12 (25% | none | none | 75%) |   |   Powershell_RedirectTo: (Powershell_RedirectToNumber | Powershell_Literal | Powershell_Filename | Powershell_Variable)
3 all all |   |   |   Powershell_RedirectToNumber: ['&'] Powershell_Number
34,095 (14% | 20% | 0% | 0% | 0% | none | 1% | 1% | 2% | 0% | 0% | 3% | 1% | 0% | none | 0% | 11% | 0% | 0% | 1% | 1% | 22% | none | 0% | 0% | 0% | 0% | 5% | 1% | 3% | 2% | 0% | 0% | 0% | none | 9% | 1% | 0%) Powershell_Expression: (Powershell_Number | Powershell_Literal | Powershell_TestPath | Powershell_GetChildItem | Powershell_GetContent | Powershell_PreIncrementExpression | Powershell_PostIncrementExpression | Powershell_LogicalNotOperator | Powershell_Negative | Powershell_BangOperator | Powershell_AmpersandOperator | Powershell_ParenthesizedExpression | Powershell_List | Powershell_Dictionary | Powershell_FloorFunction | Powershell_TruncateFunction | Powershell_FunctionCall | Powershell_Cast | Powershell_EvaluateExpression | Powershell_BuiltIn | Powershell_BuiltinVariable | Powershell_VariableExpression | Powershell_LibraryVariable | Powershell_LengthMethod | Powershell_StartsWithMethod | Powershell_SubStringMethod | Powershell_SubscriptExpression | Powershell_SubfieldExpression | Powershell_Multiplicative_Expression | Powershell_Additive_Expression | Powershell_Relational_Expression | Powershell_LogicalAnd_Expression | Powershell_LogicalOr_Expression | Powershell_Match_Expression | Powershell_IsExpression | Powershell_AssignmentExpression | Powershell_PipeExpression | Powershell_RangeExpression)
569 all 80% 2.08(60%) 1.00(0%) all Powershell_ExpressionList: [Powershell_EndOfLine] [Powershell_Expression] [Powershell_MoreExpression]* [Powershell_Comment]* [Powershell_EndOfLine]
717 all 1.00(1%) all all |   Powershell_MoreExpression: ',' [Powershell_Comment]* [Powershell_EndOfLine] Powershell_Expression
124 all 3.79 all all all Powershell_Library: '[' Powershell_Identifier_Reference* ["+FTP"] ']' "::"
142 all all all 1.54(88%) all all Powershell_Parameters: "Param" '(' [Powershell_EndOfLine] [Powershell_Param]* ')' [Powershell_EndOfLine]
192 (11% | 85% | 4%) |   Powershell_Param: (Powershell_ParamSwitch | Powershell_Parameter | Powershell_CommentEoln)
22 all all all all all 68% 14% all |   |   Powershell_ParamSwitch: '[' "Switch" ']' [Powershell_EndOfLine] Powershell_Variable [Powershell_SwitchValue] [','] [Powershell_EndOfLine]
15 all all |   |   |   Powershell_SwitchValue: '=' Powershell_Expression
163 all all all all 3.00 all all all none 58% all 35% all |   |   Powershell_Parameter: '[' "Parameter" '(' [Powershell_EndOfLine] Powershell_ParameterOption* ')' ']' [Powershell_EndOfLine] [Powershell_AliasParam] [Powershell_CastParam] [Powershell_Variable] [','] [Powershell_EndOfLine]
    |   |   |   Powershell_AliasParam: '[' "Alias" '(' Powershell_Literal ')' ']' [Powershell_EndOfLine]
94 all all all all |   |   |   Powershell_CastParam: '[' Powershell_Type ']' [Powershell_EndOfLine]
326 (none | 50% | 50%) |   |   |   Powershell_ParameterOption: (Powershell_ParameterHelpMessage | Powershell_ParameterMandatory | Powershell_ParameterPosition)
    |   |   |   |   Powershell_ParameterHelpMessage: "HelpMessage" '=' Powershell_Expression
163 all all all |   |   |   |   Powershell_ParameterMandatory: "Mandatory" '=' Powershell_Expression
163 all all all |   |   |   |   Powershell_ParameterPosition: "Position" '=' Powershell_Expression
223 2.45(13%) 1.00(1%) 64% 64% 1.44(24%) 21.93(all) Powershell_Program: [Powershell_CommentEoln]* [Powershell_Directive]* [Powershell_CmdletBinding] [Powershell_Parameters] [Powershell_CommentEoln]* [Powershell_Element]*
257 all 1% Powershell_Type: Powershell_BaseType [Powershell_TypeBrackets]
257 (1% | 99%) |   Powershell_BaseType: (Powershell_SystemType | ("Array"|"Boolean"|"Char"|"DateTime"|"Double"|"Float"|"Int"|"Int32"|"Int64"|"Long"|"PSCredential"|"SecureString"|"String"|"Xml"))
2 all 2.50 |   |   Powershell_SystemType: ("Net"|"System") Powershell_SystemSubType*
5 all all |   |   |   Powershell_SystemSubType: '.' Powershell_Identifier_Reference
2 all all |   Powershell_TypeBrackets: '[' ']'
8,603 all 3% all 3% Powershell_Variable: '$' [Powershell_VariableScope] Powershell_Variable_Reference [Powershell_Subscript]
247 all all all |   Powershell_Subscript: '[' Powershell_Expression ']'
279 all all |   Powershell_VariableScope: ("env"|"global"|"script"|"variable") ':'
    Powershell_BeginBlock: "Begin" [Powershell_EndOfLine] '{' [Powershell_EndOfLine] Powershell_Element* '}'
29 all Powershell_BreakStatement: "Break"
3,251 all 2.35(96%) Powershell_Command: Powershell_WhichCommand [Powershell_CommandArg]*
7,291 all 0% |   Powershell_CommandArg: Powershell_CommandOneArg [',']
7,291 (7% | 91% | 2%) |   |   Powershell_CommandOneArg: (Powershell_Filename | Powershell_Expression | Powershell_Word)
3,251 (2% | 12% | 0% | none | 18% | 68%) |   Powershell_WhichCommand: ('&' | '.' | ".." | ':' | Powershell_VerbNoun | Powershell_Function_Reference)
96 all Powershell_ContinueStatement: "Continue"
2 all all all 2.50 all all all all Powershell_DoStatement: "Do" '{' [Powershell_EndOfLine] Powershell_Element* '}' [Powershell_EndOfLine] ("Until"|"While") Powershell_Expression
121 all 68% Powershell_ExitStatement: "Exit" [Powershell_Expression]
3,545 all Powershell_ExpressionStatement: Powershell_Expression
459 all 64% all all all 3.33 all Powershell_ForEachStatement: Powershell_ForEach [Powershell_ForEachParams] [Powershell_EndOfLine] '{' [Powershell_EndOfLine] Powershell_Element* '}'
459 (0% | 100%) |   Powershell_ForEach: ('%' | ("ForEach"|"ForEach-Object"))
296 all all all all all |   Powershell_ForEachParams: '(' Powershell_Variable "in" Powershell_Expression ')'
20 all all all all all all all all all all all all 3.65 all Powershell_ForStatement: "For" '(' Powershell_Variable '=' Powershell_Expression ';' Powershell_Expression ';' Powershell_Expression ')' '{' [Powershell_EndOfLine] Powershell_Element* '}'
141 all all 78% all all all 6.96(all) all Powershell_Function: "Function" Powershell_Function_Definition [Powershell_FunctionParams] [Powershell_EndOfLine] '{' [Powershell_EndOfLine] [Powershell_Element]* '}'
165 8% all |   Powershell_FunctionParam: [Powershell_CastParameter] Powershell_Variable
14 all all all |   |   Powershell_CastParameter: '[' Powershell_Type ']'
110 all 2.63(83%) all |   Powershell_FunctionParams: '(' [Powershell_FunctionParam]* ')'
1,091 all all all all all all all 1.84(100%) all all 2.36(3%) 14% Powershell_IfStatement: "If" '(' Powershell_Expression ')' [Powershell_EndOfLine] '{' [Powershell_EndOfLine] [Powershell_Element]* '}' [Powershell_EndOfLine] [Powershell_IfElseIfStatement]* [Powershell_IfElseStatement]
66 all all all all all all 1.53(91%) all all |   Powershell_IfElseIfStatement: "ElseIf" '(' Powershell_Expression ')' '{' [Powershell_EndOfLine] [Powershell_Element]* '}' [Powershell_EndOfLine]
151 all all all 2.47(99%) all |   Powershell_IfElseStatement: "Else" '{' [Powershell_EndOfLine] [Powershell_Element]* '}'
    Powershell_ProcessBlock: "Process" [Powershell_EndOfLine] '{' [Powershell_EndOfLine] Powershell_Element* '}'
109 all 62% Powershell_ReturnStatement: "Return" [Powershell_Expression]
1 all all 2.00 Powershell_StartJob: "Start-Job" [Powershell_EndOfLine] Powershell_StartJobOption*
2 (50% | 50%) |   Powershell_StartJobOption: (PowerShell_StartJobCredential | PowerShell_StartJobScriptBlock)
1 all all |   |   PowerShell_StartJobCredential: "-Credential" Powershell_Variable
1 all all all 9.00 all |   |   PowerShell_StartJobScriptBlock: "-ScriptBlock" '{' [Powershell_EndOfLine] Powershell_Element* '}'
1 all all all all all all all 3.00(all) all all Powershell_SwitchStatement: "Switch" '(' Powershell_Expression ')' [Powershell_EndOfLine] '{' [Powershell_EndOfLine] [Powershell_SwitchCases]* '}' [Powershell_EndOfLine]
3 all all all 1.00(all) all all |   Powershell_SwitchCases: Powershell_SwitchCondition '{' [Powershell_EndOfLine] [Powershell_Element]* '}' [Powershell_EndOfLine]
3 (33% | 67%) |   Powershell_SwitchCondition: ("Default" | Powershell_Expression)
5 all all Powershell_ThrowStatement: "Throw" [Powershell_Expression]
56 all all all all 2.96(all) all 1.02(all) none Powershell_TryStatement: "Try" [Powershell_EndOfLine] '{' [Powershell_EndOfLine] [Powershell_Element]* '}' [Powershell_CatchBlock]* [Powershell_FinallyBlock]
57 all 2% all all 1.65(all) all |   Powershell_CatchBlock: "Catch" [Powershell_CatchType] '{' [Powershell_EndOfLine] [Powershell_Element]* '}'
1 all all all |   |   Powershell_CatchType: '[' Powershell_Type ']'
    |   Powershell_FinallyBlock: "Finally" '{' [Powershell_EndOfLine] [Powershell_Element]* '}'
25 all all all 1.32 all Powershell_WhereStatement: Powershell_Where '{' [Powershell_EndOfLine] Powershell_Element* '}'
25 (none | all) |   Powershell_Where: ('?' | ("Where"|"Where-Object"))
24 all all all all 3.88 all Powershell_WhileStatement: "While" Powershell_Expression '{' [Powershell_EndOfLine] Powershell_Element* '}'
1,056 all 1.20(1%) 1.08 none Powershell_WriteStatement: ("Write-Error"|"Write-Host"|"Write-Output") [Powershell_WriteOption]* Powershell_Expression* [Powershell_WriteOption]*
12 (33% | 67%) |   Powershell_WriteOption: (Powershell_WriteOptionColor | ("-NoNewLine"))
4 all all |   |   Powershell_WriteOptionColor: "-ForegroundColor" ("Green"|"Yellow")

Terminals = 12 (instances=41,916)
Tokens = 137 (instances=145,448)

(*) Statistics are shown in the same order as the Tokens.
Percentages are rounded; 'all' and 'none' mean 100% and 0% before rounding.
For lists, it shows the average number of occurrences, excluding empty lists.