Parsing Exception#

Severity: (Fatal) Input processing has been stopped

Explanation#

Parsing exceptions indicates a syntactical problem with the input; i.e., the Orc parser could not match the input to a valid pattern of the Orc grammar. There are many cases that could cause this -- see below for some common examples.

Advice about this Orc compiler message is below. Since people use Orc in various ways, we've given you the power to enhance this write-up with your perspective. Edit

Syntax References#

Some of the More Common Messages and Their Usual Causes#

  • end of input
    • The goal expression of the program is missing.
    • The right hand side expression of a combinator is missing.
    • An expression is missing after a comma.
    • The expression following declarations has a parse ambiguity; namely, it starts with a parenthesis ( or minus -.
  • `::' expected
    • The `=' is missing in front of the function definition.
    • Note: To specify the return type of the function use `::' along with the type name.
  • `>' expected
    • The sequential combinator `>>' was mis-typed as `>'.
    • `>' was used as the greater than operator. The greater than operator in Orc is `:>'.
  • `<' expected
    • The pruning combinator `<<' was mis-typed as `<'.
    • `<' was used as the less than operator. The less than operator in Orc is `<:'.
  • after declaration, expression expected
    • The right hand side expression of a combinator is missing.
  • expression expected, but `if' found
    • An if then else expression needs enclosing parenthesis

Orc Syntax Tips#

  • The Orc greater than/less than comparison operators are <: and :>, to distinguish them from the sequential and pruning combinators, < and >.
  • Semicolon in Orc is not a statement separator.
  • When using combinators together, in absence of parenthesis, they are parsed according to the precedence given in this table.
  • If a goal expression (function or program body expression) starts with ( or -, add # before the expression to eliminate the parse ambiguity.

See other Orc messages

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-32) was last changed on 03-Oct-2013 07:55 by John Thywissen