Eagle Legacy Modernization, LLC

TCL Grammar

Main program: TCL_Program

TCL syntax:

 Count  Terminals:
13 TCL_Comment: # comment to end of line
26 TCL_EndOfLine: End of line
  TCL_Function_Definition: An identifier
9 TCL_Function_Reference: An identifier
  TCL_HexNumber: A hex number
25 TCL_Identifier_Reference: An identifier
2 TCL_Literal: Literal quotes:" escape:\ doubled:no multiline:no
  TCL_Namespace_Definition: An identifier
4 TCL_Number: Number exponent_chars:Ee suffix_chars:Ll trailing_period:yes ignore_char:none
  TCL_Variable_Definition: An identifier
 Count  Statistics(*) Tokens:
3 all all all TCL_AdditiveExpression: TCL_Expression ("+"|"-") TCL_Expression
1 all none 1.00 all TCL_ArrayExpression: '{' [TCL_Comment]* TCL_Expression* '}'
    TCL_BitwiseExpression: TCL_Expression ("&"|"|"|"^") TCL_Expression
    TCL_BitwiseNotExpression: '~' TCL_Expression
    TCL_BuiltIns: ("false"|"true"|"$false"|"$true")
    TCL_LogicalAndExpression: TCL_Expression TCL_AndOperator TCL_Expression
    |   TCL_AndOperator: ("and" | "&&")
1 all all TCL_LogicalNotExpression: '!' TCL_Expression
    TCL_LogicalOrExpression: TCL_Expression TCL_OrOperator TCL_Expression
    |   TCL_OrOperator: ("or" | "||")
1 all all all TCL_MultiplicativeExpression: TCL_Expression ("*"|"/"|"%") TCL_Expression
    TCL_ParenthesizedExpression: '(' TCL_Expression ')'
2 all all all TCL_RelationalExpression: TCL_Expression TCL_RelOperator TCL_Expression
2 (none | all) |   TCL_RelOperator: (("lt"|"le"|"eq"|"ne"|"gt"|"ge") | ("<"|">"|"<="|">="|"=="|"<>"|"!="))
    TCL_SignedExpression: ("+"|"-") TCL_Expression
17 all TCL_VariableExpression: TCL_Variable
1 all all all all TCL_BracketExpr: '[' "expr" TCL_Expression ']'
6 all all 1.67(all) all TCL_BracketFunction: '[' TCL_Function_Reference [TCL_Expression]* ']'
2 all all all all all TCL_BracketLindex: '[' "lindex" TCL_Variable TCL_Expression ']'
    TCL_BracketStringCat: '[' "string" "cat" TCL_Expression* ']'
    TCL_BracketStringFirst: '[' "string" "first" TCL_Expression TCL_Variable [TCL_Expression] ']'
    TCL_BracketStringLength: '[' "string" "length" TCL_Expression ']'
    TCL_AppendStatement: "append" TCL_Variable TCL_Expression
3 all all none 1.67(all) all TCL_BlockStatement: '{' [TCL_EndOfLine] [TCL_GlobalVariables] [TCL_Element]* '}'
    |   TCL_GlobalVariables: "global" TCL_Variable* TCL_EndOfLine
    TCL_BreakStatement: "break"
    TCL_ExpressionStatement: TCL_Expression [TCL_Comment]
1 all all all all all all all all all all all TCL_ForStatement: "for" '{' TCL_SetStatement '}' '{' TCL_Expression '}' '{' TCL_IncrStatement '}' TCL_Statement
3 all 1.67(all) TCL_FunctionCall: TCL_Function_Reference [TCL_Expression]*
2 all all all all all none none TCL_IfStatement: "if" ("{"|"(") TCL_Expression ("}"|")") TCL_Statement [TCL_ElseIfClause]* [TCL_ElseClause]
    |   TCL_ElseClause: "else" TCL_Statement
    |   TCL_ElseIfClause: "elseif" ("{"|"(") TCL_Expression ("}"|")") TCL_Statement
1 all all none TCL_IncrStatement: "incr" TCL_Variable [TCL_Expression]
    TCL_NamespaceStatement: "namespace" "eval" TCL_Namespace_Definition '{' TCL_EndOfLine TCL_Element* '}'
    TCL_PutsStatement: "puts" TCL_Expression
    TCL_ReturnStatement: "return" TCL_Expression
5 all all all TCL_SetStatement: "set" TCL_Variable TCL_Expression
    TCL_VariableStatement: "variable" TCL_Variable_Definition
    TCL_WhileStatement: "while" '{' TCL_Expression '}' TCL_Statement
23 1.00 none all TCL_Element: TCL_Statement* [TCL_Comment] [TCL_EndOfLine]
26 (50% | 12% | none | none | none | 4% | 8% | none | none | none | none | 15% | none | none | 12% | none) |   TCL_Statement: (TCL_Comment | TCL_BlockStatement | TCL_Procedure | TCL_AppendStatement | TCL_BreakStatement | TCL_ForStatement | TCL_IfStatement | TCL_IncrStatement | TCL_NamespaceStatement | TCL_PutsStatement | TCL_ReturnStatement | TCL_SetStatement | TCL_VariableStatement | TCL_WhileStatement | TCL_FunctionCall | TCL_ExpressionStatement)
40 (none | 10% | 5% | none | none | 3% | none | 43% | none | 3% | 3% | 5% | none | none | none | 15% | 3% | 8% | 5% | none | none | none) TCL_Expression: (TCL_HexNumber | TCL_Number | TCL_Literal | TCL_SignedExpression | TCL_BitwiseNotExpression | TCL_LogicalNotExpression | TCL_BuiltIns | TCL_VariableExpression | TCL_ParenthesizedExpression | TCL_ArrayExpression | TCL_BracketExpr | TCL_BracketLindex | TCL_BracketStringFirst | TCL_BracketStringLength | TCL_BracketStringCat | TCL_BracketFunction | TCL_MultiplicativeExpression | TCL_AdditiveExpression | TCL_RelationalExpression | TCL_BitwiseExpression | TCL_LogicalAndExpression | TCL_LogicalOrExpression)
    TCL_Procedure: "proc" TCL_Function_Definition '{' [TCL_Variable_Definition]* '}' TCL_BlockStatement
1 18.00 TCL_Program: TCL_Element*
25 all all TCL_Variable: ['$'] TCL_Identifier_Reference

Terminals = 10 (instances=79)
Tokens = 45 (instances=166)

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