00:02
ulfdoz has quit ["arg!"]
00:09
ulfdoz has joined #ocaml
00:37
mnemonic has quit [Read error: 110 (Connection timed out)]
01:12
noteventime has quit ["Leaving"]
01:14
gim__ has joined #ocaml
01:25
Oatmeat has joined #ocaml
01:26
<
Oatmeat >
how can I determine the current file name from within a ocamlyacc grammar?
01:27
<
mikeX >
Oatmeat: I've seen it done with a camlp4 module
01:29
<
Oatmeat >
in general is there an easy way to pass information to ocamlyacc?
01:29
<
Oatmeat >
it generates its own mli file which hides any functions in your mly file
01:29
<
mikeX >
Oatmeat: you can import modules in the 1st section
01:31
<
Oatmeat >
right, but I'm looking to expose a function outside the mly file
01:31
<
Oatmeat >
so I can call a function like setCurrentFileName
01:31
gim_ has quit [Read error: 110 (Connection timed out)]
01:33
<
mikeX >
not sure I understand why you want to do that
01:33
<
Oatmeat >
well the parser is going to read a declaration at the top of the file which gives the module name
01:33
<
Oatmeat >
and I want to ensure that the module name is consistent with the file name
01:34
<
Oatmeat >
so if I parse file.mod, I expect a line like "module file"
01:34
<
mikeX >
ok, but why do you need to call something defined in the parser?
01:37
<
Oatmeat >
well I just need the parser to know the file name
01:38
<
Oatmeat >
so I was going to add a reference variable in the parser
01:38
<
Oatmeat >
and have the setCurrentFilename function modify that variable
01:38
<
mikeX >
add the reference value somewhere else, and update it from within the parser
01:39
<
mikeX >
Oatmeat: I'm confused actually, which filename are you refering to?
01:39
<
mikeX >
what sort of program are you writing?
01:39
<
Oatmeat >
the name of the file being parser
01:40
<
Oatmeat >
the program is a compiler
01:40
<
mikeX >
well that's something you should know from the environment
01:40
<
mikeX >
a command line parameter passed to your compiler for example
01:40
<
Oatmeat >
I do have the filename in my program
01:41
<
Oatmeat >
I just don't know how to make the parser aware of the filename
01:41
<
mikeX >
simple, store it somewhere as a global variable
01:44
<
mikeX >
for example, if you have a module Utils, you could store it there as a global variable, and retrieve it from the parser with Open Utils
01:44
<
mikeX >
maybe there's a better way
01:45
<
mikeX >
like giving it as a parameter to your parsing function
01:47
<
mikeX >
I only used filenames for error reporting in my compiler, so I storred it in some structure in a module Error, where the appropriate error reporting functions used it
01:47
<
Oatmeat >
alright, I'll try that
01:55
<
mikeX >
that's the structure I used, but it has to be updated manually from within the lexer I think
01:55
<
Oatmeat >
yeah I wasn't sure how pos_fname gets set for that structure
01:55
<
Oatmeat >
because when I used it, pos_fname was the empty string
01:56
<
Oatmeat >
so I guess I have to set it myself at some point
01:56
<
Oatmeat >
not sure how to do that in the lexer
01:56
<
mikeX >
yes, but only if you need it
01:56
<
mikeX >
you can just set fname at the start, and read it from within the parser
01:56
<
Oatmeat >
do you know how to set it?
01:57
<
mikeX >
let main file =
01:57
<
mikeX >
let ic = open_file file in
01:57
<
mikeX >
if !flag_verbose = Vverbose then printf "-> opening '%s'\n%!" file;
01:57
<
mikeX >
let lexbuf = Lexing.from_channel ic in
01:57
<
mikeX >
lexbuf.lex_curr_p <- { lexbuf.lex_curr_p with pos_fname = file };
01:57
<
Oatmeat >
I didn't know how to get ahold of the position structure
01:57
<
mikeX >
while true do Alan_parser.program Alan_lexer.lexer lexbuf done
01:57
<
mikeX >
that's an extract of my controlling function
01:57
<
Oatmeat >
so just modify lexbuf.lex_curr_p I guess
01:58
<
mikeX >
then in the lexer i call this in almost every rule:
01:59
<
mikeX >
let incr_pos lexbuf = g_position := position_context lexbuf.lex_start_p lexbuf.lex_curr_p
01:59
<
mikeX >
hmm, it seems I kept a global var of the position, can't remember why
01:59
<
mikeX >
i wrote that a year ago
01:59
<
Oatmeat >
I think position gets tracked automatically
02:00
<
Oatmeat >
you just need an incrline function for detecting newlines
02:00
<
mikeX >
yeah I have that too
02:00
<
mikeX >
hmm, I use a special position type
02:00
<
mikeX >
type position =
02:00
<
mikeX >
PosPoint of Lexing.position
02:00
<
mikeX >
| PosContext of Lexing.position * Lexing.position
02:01
<
mikeX >
well that part is not my code, so I can't recall the logic behind it now
02:01
<
mikeX >
let incr_line lexbuf =
02:01
<
mikeX >
lexbuf.lex_curr_p <- { lexbuf.lex_curr_p with
02:01
<
mikeX >
pos_lnum = lexbuf.lex_curr_p.pos_lnum + 1;
02:01
<
mikeX >
pos_bol = lexbuf.lex_curr_p.pos_cnum;
02:01
<
mikeX >
if !flag_verbose = Vverbose then printf "line %d\n%!" lexbuf.lex_curr_p.pos_lnum
02:01
<
mikeX >
and that's for newlines
02:02
<
mikeX >
what's the compiler for? school project?
02:03
<
Oatmeat >
research project for a fellow student
02:03
<
Oatmeat >
I'm helping her with setting up the build process
02:04
<
Oatmeat >
and so I had to remove a cyclic dependency between her lexer and parser due to this filename issue
02:05
<
mikeX >
gotta go, goodnight
02:06
mikeX has quit ["leaving"]
02:37
jeffs has joined #ocaml
03:25
shekmalhen has quit ["Méritez votre liberté, fainéants"]
03:38
Ai_Itai has quit ["Leaving"]
04:01
malar has quit ["Lost terminal"]
05:58
bzzbzz has joined #ocaml
05:59
bzzbzz has quit [Client Quit]
06:53
<
kelaouchi >
is there any Qt binding for OCaml ?
06:56
jeffs has quit [Read error: 54 (Connection reset by peer)]
07:37
tree_ is now known as tree
07:38
tree is now known as trisiak
07:39
trisiak is now known as tree
08:02
_JusSx_ has joined #ocaml
08:10
Mr_Awesome has quit ["...and the Awesome level drops"]
08:31
smimou has joined #ocaml
09:15
<
kelaouchi >
Any idea ?
09:23
mnemonic has joined #ocaml
09:31
BleSS has joined #ocaml
09:45
<
BleSS >
I'm not the author of that page, but I thinked that would interesting to add another languages to make a reasonable performance comparison - to contact with the author: erik@timestretch.com
09:55
<
pango >
btw I suspect some versions compute the set for -39..39/-39..39 ranges, others for -39..38/-39..38 only
09:57
mnemonic has quit [Read error: 104 (Connection reset by peer)]
10:09
<
BleSS >
pango: thanks
10:13
joshcryer has quit [Read error: 104 (Connection reset by peer)]
10:14
joshcryer has joined #ocaml
10:18
BleSS has quit ["Konversation terminated!"]
10:46
bluestorm_ has joined #ocaml
10:52
rwmjones has joined #ocaml
11:06
ezraburgh has joined #ocaml
11:42
<
G >
rwmjones: oh hey
11:42
<
rwmjones >
hello - Nigel Jones, right?
11:43
<
rwmjones >
I've got a big queue of packages to be reviewed .. no one seems much interested in them unfortunately :-(
11:43
<
G >
rwmjones: oh, I found out the hold up for Fedora sponsorship, apparently it's because they'd perfer that the draft guidelines became final ;)
11:43
<
G >
rwmjones: but I do have a few comments on the package I was looking at, I'll just have to look at my buildlogs
11:51
<
G >
rwmjones: oh yeah, you have a missing builddep on ocaml-findlib
11:52
<
rwmjones >
in which package is that?
11:52
<
G >
I believe the package is just m4 ;)
11:52
<
rwmjones >
the macro preprocessor?
11:53
<
rwmjones >
ah, right got you
11:53
<
G >
yeah, it's not in the default build environments
11:53
<
rwmjones >
you mean ocaml-findlib builddeps m4!
11:53
* rwmjones
thought you meant the other way around for a minute there ...
11:54
<
G >
rwmjones: oh whoops, sorry ;)
11:54
<
rwmjones >
ok, I've added that in my private copy
11:54
<
rwmjones >
did you get the find-requires/find-provides stuff working? and what did you think?
11:54
<
G >
want to build another -1?
11:55
<
rwmjones >
for ocaml-findlib? here I'm up to release -2 becaues I added the find-requires/find-provides stuff
11:55
<
rwmjones >
is there a problem with reviewing/releasing with release numbers > 1?
11:56
<
G >
I had one that reached -6 by the time it was accepted
11:59
<
G >
rwmjones: btw, I'm working on getting a 3.10.0 ocaml package ready
11:59
<
rwmjones >
ok, so there's the -3 release which has that builddep
11:59
<
rwmjones >
yup, it's a good idea. However at the moment I'm conservatively sticking with 3.09.3 because of all the camlp4 changes in the latest.
12:00
<
rwmjones >
I sent Gerard some patches against the base ocaml. Shall I send them to you?
12:00
<
G >
I'll see if I can convince gemi to include those ocaml-find-provides/requires stuff then
12:01
<
G >
if you want, I'm actually the maintainer of the EL- branches
12:02
<
rwmjones >
ok, I mailed you one patch - it just makes sure that tools/objinfo gets packaged, works same way as Debian
12:03
<
G >
ahhh right, I think I ran into that problem building 3.10.0
12:04
<
rwmjones >
(that patch is cumulative over the one I sent you by email)
12:04
<
G >
yeah, I saw the ML patch
12:30
ygrek has joined #ocaml
12:45
screwt839 has joined #ocaml
12:47
screwt8 has quit [Read error: 104 (Connection reset by peer)]
12:54
screwt839 has left #ocaml []
13:09
<
rwmjones >
G, I'm off now, but I've just done packages for ocamlnet, ssl, ulex and pxp
13:10
<
rwmjones >
all based on OCaml 3.09.3
13:11
rwmjones has quit ["Closed connection"]
13:29
EliasAmaral has quit [Success]
13:54
noteventime has joined #ocaml
14:07
mnemonic has joined #ocaml
14:10
ezraburgh has quit []
14:15
rwmjones has joined #ocaml
14:20
Riesz has quit ["Leaving.."]
14:21
Riesz has joined #ocaml
15:07
orcamsmacro has joined #ocaml
15:15
orcamsmacro has left #ocaml []
15:18
_JusSx_ has quit ["leaving"]
15:20
pango has quit [Remote closed the connection]
15:24
pango has joined #ocaml
15:30
pango has quit ["Terminated with extreme prejudice - dircproxy 1.0.5"]
15:31
pango has joined #ocaml
15:48
malar has joined #ocaml
16:00
tree has quit [Nick collision from services.]
16:05
tree_ has joined #ocaml
16:10
rwmjones has quit ["Closed connection"]
16:19
screwt8 has joined #ocaml
16:55
benny__ has joined #ocaml
16:56
malar has quit [Read error: 110 (Connection timed out)]
17:11
benny_ has quit [Read error: 110 (Connection timed out)]
17:32
JeffSmac has joined #ocaml
17:35
schme has joined #ocaml
17:38
bluestorm_ has quit ["Konversation terminated!"]
17:50
benny__ is now known as klapmuetz
18:12
JeffSmac has quit []
18:16
piggybox has quit [Read error: 60 (Operation timed out)]
18:42
<
kelaouchi >
ok thx pango
18:45
<
Smerdyakov >
You're welcome.
19:31
slipstream-- has quit [Read error: 104 (Connection reset by peer)]
19:36
slipstream has joined #ocaml
20:18
mnemonic has quit ["leaving"]
20:57
Mr_Awesome has joined #ocaml
21:03
screwt8 has quit [Remote closed the connection]
21:09
_JusSx_ has joined #ocaml
21:55
screwt8 has joined #ocaml
21:56
descender has quit [Remote closed the connection]
21:57
_JusSx_ has quit ["leaving"]
22:35
smimou has quit ["bli"]
22:45
descender has joined #ocaml
22:46
descender has quit [Remote closed the connection]
22:58
mwc has joined #ocaml
23:02
bluestorm_ has joined #ocaml
23:28
bzzbzz has joined #ocaml
23:57
scruffie has joined #ocaml