This site is updated infrequently. For up-to-date information, please visit the new OCaml website at ocaml.org.

[Caml-list] Camlp4-tutorial-Example
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
 Date: 2002-09-03 (07:08) From: Daniel de Rauglaudre Subject: Re: [Caml-list] Camlp4-tutorial-Example
```Hi,

On Mon, Sep 02, 2002 at 10:52:27PM +0200, Oliver Bandel wrote:

> What I do not understand:
> This calculator knows that * and / have higher Priority
> than + and -.
> How is this achieved?

By the order of the rules. The rules with same priority are grouped
together:
[ ... | ... | ... ]

and there is another level of parentheses (of bracket parentheses)
separated by vertical bars to indicate the priority:
[
[ ... | ... | ... ]        (* lowest priority *)
| [ ... | ... | ... ]        ...
| [ ... | ... | ... ]        (* highest priority *)
]

> I didn't find any entries, that provide priority-distinction
> between +,-,*,/.

Forget Yacc! :-)

> Is the Grammar-Module magic?
> (Gramagic?)

What do you mean by "magic"?

--
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

```