Practical Scala DSLs by Pierluigi Riti

Practical Scala DSLs by Pierluigi Riti

Author:Pierluigi Riti
Language: eng
Format: epub
Publisher: Apress, Berkeley, CA


Parser1 ^ ^ f

Functional combinator: This creates a function with the output value of the parser.

Every parser returns a value of success, if the parsing operation terminates properly, or of failure, if the operation terminates in an error. It is possible to read this value from the object ParserResult. We can use this object to know exactly what’s going wrong in our parser operation.

A Simple Sample Parser

Until now, I have discussed only how to create a parser combinator . What we want to do now is create a simple parser for executing some basic mathematical operation.

The parsing library defines some basic operations that we can combine to create a more complex operation. The basic operations that we can find in the library areMatching token



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.