This folder contains example grammars and rewrite rules to be used with 
MercuryParser application.

File extensions
===============

*.grm        grammar file
*.rwr        rewrite rules
*.in         example inputs (optional).

Languages
=========

catalan      - grammar describes the language {x^n | 1 <= n } with as many 
               as possible derivation trees WITHOUT epsilon rules.
             - rewrite rules translate trees into strings where each string
               represents one possible bracketing of the input.
expr         - grammar defines basic arithmetic expressions with explicit
               bracketing required and operators +, -, * and /.
             - evaluates the expression and returns a number
rpn          - same grammar as expr
             - rewrites the expression into Reverse Polish Notation.
nadrazi      - grammar defines a simple Czech queries for a train station
               automaton.
             - rewrite rules extract all important information from the query.
bc.in        - contains examples of sentences that MQNLParser recognizes
             - these are also inputs of Text B (see QuickStart.pdf in Executables)

Example with MercuryParser
==========================

Use :h (:help) to invoke help.
> :l catalan.grm catalan.rwr
Files loaded successfully

Interpret> x x x x
Result:           Success
Parser time:      00:00.02
Interpreter time: 00:00.13
Total time:       00:00.16
Edges in chart:         36
Derivation trees:        5
Interpretations:         5

Interpret> :i
0: ((x x) (x x))
1: (x (x (x x)))
2: (x ((x x) x))
3: ((x (x x)) x)
4: (((x x) x) x)


