parser-combinators

    9热度

    1回答

    我想为下面的命令定义一个语法。 action = todo message = link todo to database properties = [deadline: next tuesday, context: app.model] 当运行如下所定义的语法这个输入时,收到以下错误消息:: [1.27] parsed: Command(todo,link todo to databas

    11热度

    1回答

    我有以下EBNF,我想分析: PostfixExp -> PrimaryExp ("[" Exp "]" | . id "(" ExpList ")" | . length)* 这是我得到: def postfixExp: Parser[Expression] = ( primaryExp ~ rep( "[" ~ expre

    2热度

    1回答

    我正在阅读Bernie Pope的幻灯片"Parser combinators in Scala"。他引用了“另类”的方法签名类型Combinator的|: def | [U >: T](q: => Parser[U]): Parser[U] ,问道:“家庭作业:为什么不呢|有这种类型改为” def | [U](q: => Parser[U]): Parser[Either[T,U]]