List Info

Thread: "ocaml_beginners"::[] My first ocamllex program




"ocaml_beginners"::[] My first ocamllex program
country flaguser name
United States
2007-05-08 09:00:45

I've created my first ocamllex program using the simple example in the
tutorialbr>
{ }
rule translate = parse
| "current_directory" { print_string (Sys.getcwd ()); translate lexbuf }
| _ as c { print_char c; translate lexbuf }
| eof { exit 0 }

I have successfully compile it. I tried running itbr>
./main.exe <test.dat

but I get no output or errors. I'm using the windows verison 3.09.

What am I doing wrong?

Chris
--
Chris Velevitch
Manager - Sydney Flash Platform Developers Group
m: 0415 469 095
www.flashdev.org.au

__._,_.___
.

__,_._,___
Re: "ocaml_beginners"::[] My first ocamllex program
country flaguser name
United States
2007-05-08 09:42:17

On Tue, 8 May 2007, Chris Velevitch wrote:

> I've created my first ocamllex program using the simple example in the
> tutorialbr> >
> { }
> rule translate = parse
&gt; | "current_directory" { print_string (Sys.getcwd ()); translate lexbuf }
> | _ as c { print_char c; translate lexbuf }
> | eof { exit 0 }
>
> I have successfully compile it. I tried running itbr> >
> ./main.exe <test.dat
>
> but I get no output or errors. I'm using the windows verison 3.09.
&gt;
> What am I doing wrong?

The problem here (from what little info you've included) is that while
you have defined your lexer, you don't have any code there to call it.
Did you include the footer code from the example that provides this call?
If so, what is the contents of test.dat?

William D. Neumann

---

"There's just so many extra children, we could just feed the
children to these tigers. We don't need them, we're not doing
anything with them.

Tigers are noble and sleek; children are loud and messy.&quot;

-- Neko Case

Life is unfair. Kill yourself or get over it.
-- Black Box Recorder

__._,_.___
.

__,_._,___
Re: "ocaml_beginners"::[] My first ocamllex program
country flaguser name
France
2007-05-08 13:10:00

Hi Chris !

Sorry not to help you : William did this.

> I've created my first ocamllex program using the simple example in the
> tutorialbr> >
> { }
> rule translate = parse
&gt; | "current_directory" { print_string (Sys.getcwd ()); translate lexbuf }
> | _ as c { print_char c; translate lexbuf }
> | eof { exit 0 }

Please, do you have the link of this tutorial ?

Thanks !

Fabrice

__._,_.___
.

__,_._,___
Re: "ocaml_beginners"::[] My first ocamllex program
country flaguser name
United States
2007-05-08 15:17:51

On Tue, 8 May 2007, Fabrice Marchant wrote:

> Please, do you have the link of this tutorial ?

http://plus.kaist.ac.kr/~shoh/ocaml/ocamllex-ocamlyacc/ocamllex-tutorial/

William D. Neumann

---

"There's just so many extra children, we could just feed the
children to these tigers. We don't need them, we're not doing
anything with them.

Tigers are noble and sleek; children are loud and messy.&quot;

-- Neko Case

Life is unfair. Kill yourself or get over it.
-- Black Box Recorder

__._,_.___
.

__,_._,___
Re: "ocaml_beginners"::[] My first ocamllex program
country flaguser name
France
2007-05-08 13:29:15

> > Please, do you have the link of this tutorial ?
>
> http://plus.kaist.ac.kr/~shoh/ocaml/ocamllex-ocamlyacc/ocamllex-tutorial/

Thank you very much William ! This was an important doc that missed me.

Best regards.

Fabrice

__._,_.___
.

__,_._,___
Re: "ocaml_beginners"::[] My first ocamllex program
country flaguser name
United States
2007-05-09 09:50:31

On 5/8/07, William D. Neumann < wneumann%40cs.unm.edu">wneumanncs.unm.edu> wrote:
&gt; The problem here (from what little info you've included) is that while
&gt; you have defined your lexer, you don't have any code there to call it.
> Did you include the footer code from the example that provides this call?

The example in the first paragraph of Chapter 2 (Some Simple Examples)
lead me to believe this was a complete working simple example. Your
remark about the footer code gave me pause to jump ahead to find a
complete working example in Chapter 12. Thanks for the pointer.

Chris
--
Chris Velevitch
Manager - Sydney Flash Platform Developers Group
m: 0415 469 095
www.flashdev.org.au

__._,_.___
.

__,_._,___
[1-6]

about | contact  Other archives ( Real Estate discussion Medical topics )