Eagle Legacy Modernization, LLC

FSharp Grammar

Main program: FSharp_Program

FSharp syntax:

 Count  Terminals:
  FSharp_Comment: // comment to end of line
  FSharp_EndOfLine: End of line
  FSharp_Function_Definition: An identifier
  FSharp_Identifier_Reference: An identifier
  FSharp_Literal: Literal quotes:" escape:\ doubled:no multiline:no
  FSharp_Number: Number exponent_chars:Ee suffix_chars:JjLl trailing_period:yes ignore_char:none
  FSharp_StartOfLine: Start of line
  FSharp_Variable_Definition: An identifier
 Count  Statistics(*) Tokens:
    FSharp_Additive_Expression: FSharp_Expression ("+"|"-") FSharp_Expression
    FSharp_BracketBars: "[|" [FSharp_EndOfLine] [FSharp_Expression]* "|]"
    FSharp_BuiltIn: ("false"|"true")
    FSharp_FunctionCall: FSharp_Variable '(' [FSharp_Expression]* ')'
    FSharp_Logical_And_Expression: FSharp_Expression "&&" FSharp_Expression
    FSharp_Logical_Not_Expresion: "Not" FSharp_Expression
    FSharp_Logical_Or_Expression: FSharp_Expression "||" FSharp_Expression
    FSharp_Multiplicative_Expression: FSharp_Expression ("*"|"/"|"%") FSharp_Expression
    FSharp_Parens: '(' FSharp_Expression ')'
    FSharp_Range_Expression: '[' FSharp_Expression ".." FSharp_Expression ']'
    FSharp_Relational_Expression: FSharp_Expression ("="|"<>"|"<="|">="|"<"|">") FSharp_Expression
    FSharp_Subfield: FSharp_Expression '.' FSharp_Expression
    FSharp_SubscriptExpression: FSharp_Expression '.' '[' FSharp_RangeExpr ']'
    |   FSharp_RangeExpr: (FSharp_RangeExpr_low_high | FSharp_RangeExpr_low | FSharp_RangeExpr_high | FSharp_RangeJustOne)
    |   FSharp_RangeExpr_high: ".." FSharp_Expression
    |   FSharp_RangeExpr_low: FSharp_Expression ".."
    |   FSharp_RangeExpr_low_high: FSharp_Expression ".." FSharp_Expression
    |   FSharp_RangeJustOne: FSharp_Expression
    FSharp_UnarySign: ("-") FSharp_Expression
    FSharp_VariableExpression: FSharp_Variable
    FSharp_Element: [FSharp_StartOfLine] FSharp_StatementOrComment [';'] [','] [FSharp_Comment] [FSharp_EndOfLine]
    |   FSharp_MultilineStatement: [FSharp_Comment] FSharp_EndOfLine FSharp_Element*
    |   FSharp_SingleLineStatement: FSharp_Statement* [FSharp_Comment] [FSharp_EndOfLine]
    |   FSharp_SingleOrMultiLineStatement: ("..." | FSharp_MultilineStatement | FSharp_SingleLineStatement)
    |   FSharp_Statement: (FSharp_Assignment | FSharp_ForStatement | FSharp_Function | FSharp_IfStatement | FSharp_LetStatement | FSharp_PrintfnStatement | FSharp_WhileStatement | FSharp_ExpressionStatement)
    |   FSharp_StatementOrComment: (FSharp_CommentList | FSharp_Statement_List | FSharp_EndOfLine)
    |   |   FSharp_CommentList: FSharp_Comment*
    |   FSharp_Statement_List: FSharp_StartOfLine FSharp_Statement*
    FSharp_Expression: (FSharp_Number | FSharp_Literal | FSharp_BracketBars | FSharp_Parens | FSharp_FunctionCall | FSharp_UnarySign | FSharp_Logical_Not_Expresion | FSharp_BuiltIn | FSharp_VariableExpression | FSharp_Range_Expression | FSharp_SubscriptExpression | FSharp_StartsWithFunction | FSharp_LengthFunction | FSharp_Subfield | FSharp_Multiplicative_Expression | FSharp_Additive_Expression | FSharp_Relational_Expression | FSharp_Logical_And_Expression | FSharp_Logical_Or_Expression)
    FSharp_Program: [FSharp_OpenDeclaration] [FSharp_EntryPoint] FSharp_Element*
    |   FSharp_EntryPoint: '[' '<' "EntryPoint" '>' ']' FSharp_EndOfLine
    |   FSharp_OpenDeclaration: "open" "System" FSharp_EndOfLine
    FSharp_Type: (("bool"|"int"|"string"))
    FSharp_Variable: FSharp_Identifier_Reference
    FSharp_LengthFunction: FSharp_Expression '.' "Length"
    FSharp_StartsWithFunction: FSharp_Expression '.' "StartsWith" '(' FSharp_Expression ')'
    FSharp_Assignment: FSharp_Variable "<-" FSharp_Expression
    FSharp_ExpressionStatement: FSharp_Expression FSharp_EndOfLine
    FSharp_ForStatement: "for" FSharp_Variable '=' FSharp_Expression ("to"|"downto") FSharp_Expression "do" FSharp_SingleOrMultiLineStatement
    FSharp_Function: "let" FSharp_Function_Definition '(' [FSharp_FunctionParam]* ')' [FSharp_ReturnType] '=' FSharp_EndOfLine FSharp_Element*
    |   FSharp_FunctionParam: FSharp_Variable_Definition ':' FSharp_Type
    |   FSharp_ReturnType: ':' FSharp_Type
    FSharp_IfStatement: "if" FSharp_Expression "then" FSharp_SingleOrMultiLineStatement [FSharp_IfElif]* [FSharp_IfElse]
    |   FSharp_IfElif: FSharp_StartOfLine "elif" FSharp_Expression "then" FSharp_SingleOrMultiLineStatement
    |   FSharp_IfElse: FSharp_StartOfLine "else" FSharp_SingleOrMultiLineStatement
    FSharp_LetStatement: "let" ["mutable"] ["main"] FSharp_Variable [FSharp_VariableType] '=' [FSharp_EndOfLine] FSharp_Expression FSharp_EndOfLine
    |   FSharp_VariableType: ':' FSharp_Type
    FSharp_PrintfnStatement: "printfn" FSharp_Expression* FSharp_EndOfLine
    FSharp_WhileStatement: "while" FSharp_Expression "do" FSharp_SingleOrMultiLineStatement

Terminals = 8 (instances=0)
Tokens = 49 (instances=0)

(*) 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.