Browse thread
[Caml-list] Camlp4-tutorial-Example
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Oliver Bandel <oliver@f...> |
| Subject: | Re: [Caml-list] Camlp4-tutorial-Example |
Hi, On Tue, 3 Sep 2002, Daniel de Rauglaudre wrote: > 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 *) > ] [...] Ok, that was surprising. But it's a very good idea. :) BTW: The problem in the tutorial, I mentioned was my own: I wrote wrong code. But the reason was, that I didn't understand how the Camlp4 really works (the Grammar-Module). I now print the tutorial out to paper, and hope I will see problems better than on screen. But in general, Ocaml-Software seems to be written for many-years-Ocaml-programmers: They are very fluently in understanding the mli-files and using them as sufficient for programming. Maybe I should read more informations7documentations about the Module-system, so that I can rely on the same mechanism: Reading the mli-files to understand the programs. But nevertheless, an overwiev-documentation is always a good Idea. I hope that I will understand the Camlp4-tutorial, now where I can write my comments on the paper. ;-) > > > I didn't find any entries, that provide priority-distinction > > between +,-,*,/. > > Forget Yacc! :-) OK, I decided to forget it now. What is yacc? ;-) > > > Is the Grammar-Module magic? > > (Gramagic?) > > What do you mean by "magic"? It was a joke. :) It looked like the Camlp4-Preprocessor and the Grammar-Module did know, what to do, and how to handle mathematical operations. After experimenting with changing the levels of the tutorial's code, I thought, that the levels may be levels of priority. I thought, not to read it in the tutorial, but maybe I have not seen it there. I will reread the tutorial in a more patient manner. Ciao, Oliver ------------------- 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