Skip to content

Instantly share code, notes, and snippets.

@adamretter
Created September 24, 2012 17:20
Show Gist options
  • Save adamretter/3777121 to your computer and use it in GitHub Desktop.
Save adamretter/3777121 to your computer and use it in GitHub Desktop.
Scala Parser Combinators - need mutually exclusive Global Directives
def Expr = (GlobalDirectiveExpr*) ~ (ColumnRuleExpr+) ^^ {
case d ~ r => CsvSchema(d, r)
}
def GlobalDirectiveExpr = "@" ~> (SeparatorExpr | QuotedExpr | TotalColumnsExpr | NoHeaderExpr | IgnoreColumnNameCaseExpr) ^^ {
case d => Directive(d)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment