00:00
ofaurax has quit ["Leaving"]
00:05
mrsolo has quit [Connection timed out]
00:16
psnively has quit []
00:38
mrsolo has joined #ocaml
01:15
mrsolo has quit [Read error: 104 (Connection reset by peer)]
01:15
mrsolo_ has joined #ocaml
01:26
pants1 has joined #ocaml
01:41
smimou has quit ["bli"]
01:46
seafoodX has joined #ocaml
01:49
seafoodX has quit [Client Quit]
01:57
pants1 has quit [Read error: 104 (Connection reset by peer)]
02:00
david_koontz has quit []
02:00
jlouis_ has joined #ocaml
02:11
seafoodX has joined #ocaml
02:14
jlouis has quit [Read error: 110 (Connection timed out)]
02:59
buluca has quit [Read error: 113 (No route to host)]
03:27
pants1 has joined #ocaml
03:48
Mr_Awesome has quit ["aunt jemima is the devil!"]
03:53
jlouis has joined #ocaml
03:53
Mr_Awesome has joined #ocaml
04:07
jlouis_ has quit [Success]
04:19
bebui has quit [Read error: 110 (Connection timed out)]
04:27
np has joined #ocaml
04:39
bebui has joined #ocaml
04:42
np has quit [Remote closed the connection]
05:10
pants1 has quit ["Leaving."]
06:05
jonathanv has joined #ocaml
06:17
mvitale has quit [Read error: 110 (Connection timed out)]
06:21
jonafan has quit [Read error: 110 (Connection timed out)]
06:26
Tetsuo has joined #ocaml
06:26
Tetsuo has quit [Client Quit]
06:36
david_koontz has joined #ocaml
06:46
david_koontz has quit []
06:48
ygrek_ has joined #ocaml
06:48
tty56 has quit [Read error: 60 (Operation timed out)]
07:03
filp has joined #ocaml
07:18
Tetsuo has joined #ocaml
07:34
mrsolo_ has quit [Read error: 104 (Connection reset by peer)]
07:36
vpalle has joined #ocaml
08:14
Tetsuo has quit ["Leaving"]
08:15
rwmjones has joined #ocaml
08:22
seafoodX has quit []
08:47
Yoric[DT] has joined #ocaml
09:15
buluca has joined #ocaml
09:18
ita has joined #ocaml
10:01
szsz has joined #ocaml
10:25
jlouis_ has joined #ocaml
10:27
ita has quit ["Hasta luego!"]
10:40
jlouis has quit [Read error: 110 (Connection timed out)]
10:54
smimou has joined #ocaml
11:46
Yoric[DT] has quit ["Ex-Chat"]
12:17
piggybox has quit [Connection timed out]
12:26
aij has quit [zelazny.freenode.net irc.freenode.net]
12:26
c has quit [zelazny.freenode.net irc.freenode.net]
12:26
unfo- has quit [zelazny.freenode.net irc.freenode.net]
12:27
c has joined #ocaml
12:27
aij has joined #ocaml
12:27
unfo- has joined #ocaml
12:41
ygrek_ has quit [Remote closed the connection]
12:47
mvitale has joined #ocaml
12:49
jlouis has joined #ocaml
13:02
jlouis_ has quit [Read error: 110 (Connection timed out)]
13:09
piggybox has joined #ocaml
13:17
authentic has quit [Read error: 110 (Connection timed out)]
13:37
seafoodX has joined #ocaml
13:46
asmanur has joined #ocaml
13:46
seafoodX has quit []
14:15
authentic has joined #ocaml
14:17
Tetsuo has joined #ocaml
14:21
joshcryer has quit [SendQ exceeded]
14:22
vorago has quit [SendQ exceeded]
14:22
vorago has joined #ocaml
14:23
vorago has quit [SendQ exceeded]
14:27
vorago has joined #ocaml
14:40
unfo- has quit [zelazny.freenode.net irc.freenode.net]
14:40
c has quit [zelazny.freenode.net irc.freenode.net]
14:40
aij has quit [zelazny.freenode.net irc.freenode.net]
14:45
robozni has joined #ocaml
14:49
aij has joined #ocaml
14:51
c has joined #ocaml
15:03
^authentic has joined #ocaml
15:18
pango has quit [Remote closed the connection]
15:20
authentic has quit [Read error: 110 (Connection timed out)]
15:20
^authentic is now known as authentic
15:22
pango has joined #ocaml
15:38
unfo- has joined #ocaml
15:38
joshcryer has joined #ocaml
15:42
<
rwmjones >
does anyone have an example of how to write a C-style string rule in ocamllex? ie. parsing something like "foo\n"
15:42
<
rwmjones >
s/parsing/scanning/
15:43
<
asmanur >
does | "foo" -> result not work ?
15:45
schme` has quit [Connection timed out]
15:47
<
rwmjones >
ummm...?
15:49
<
asmanur >
rwmjones: what's your string exactly ?
15:49
<
rwmjones >
well that's the point, I want to scan any C-style string
15:49
<
rwmjones >
double-quote f o o backslash n double-quote
15:50
<
rwmjones >
replace the bits inside double-quotes with whatever
16:22
<
vorago >
rwmjones, hm.
16:22
<
vorago >
rwmjones, in OCaml you mark \n just like in C.
16:22
ygrek_ has joined #ocaml
16:23
mvitale_ has joined #ocaml
16:23
<
vorago >
You want to find/replace occurences of \"[^\\]+\" and replace with something like \"y\" ?
16:25
<
vorago >
Maybe Str module?
16:35
<
vorago >
let re = Str.regexp "\\\"\\(\n*.*\\)*\\\"";;
16:35
<
vorago >
# Str.global_replace re "found" "\"\nlgfdsgdf\na\" tt";;
16:35
<
vorago >
- : string = "found tt"
16:35
* vorago
loves regexes. ;P
16:36
mvitale has quit [Read error: 110 (Connection timed out)]
16:37
<
vorago >
"\"\\(\n*.*\\)*\"" simplified
16:50
buluca has quit [No route to host]
17:01
bluestorm_ has joined #ocaml
17:12
<
rwmjones >
vorago, asmanur thanks for your suggestions, but in fact I'm trying to write an ocamllex rule. In any case I worked it out:
17:12
<
rwmjones >
Buffer.clear buffer;
17:12
<
rwmjones >
scan_string lexbuf;
17:12
<
rwmjones >
let s = Buffer.contents buffer in
17:12
<
rwmjones >
STRING s
17:12
<
rwmjones >
and then later:
17:13
<
rwmjones >
and scan_string = parse
17:13
<
rwmjones >
(* end of string: return *)
17:13
<
rwmjones >
| '"' { () }
17:13
<
rwmjones >
(* escaped double-quote *)
17:13
<
rwmjones >
| '\\' '"' { Buffer.add_char buffer '"'; scan_string lexbuf }
17:13
<
rwmjones >
(* escaped backslash *)
17:13
<
rwmjones >
| '\\' '\\' { Buffer.add_char buffer '\\'; scan_string lexbuf }
17:13
<
rwmjones >
(* end of file - unclosed string *)
17:13
<
rwmjones >
| eof { fatal lexbuf "unclosed string in file" }
17:13
<
rwmjones >
(* standard character *)
17:13
<
rwmjones >
| _ as c { Buffer.add_char buffer c; scan_string lexbuf }
17:15
xavierbot has joined #ocaml
17:28
<
bluestorm_ >
rwmjones: i don't think it's possible
17:28
<
bluestorm_ >
yacc is basically about making a tree from a plain token stream
17:28
<
rwmjones >
bluestorm_, I was beginning to think that ...
17:28
<
bluestorm_ >
maybe you could give it a tree by flattening it into a stream before
17:28
<
bluestorm_ >
but i'm not sure it will be easy for you to preserve the structure while doing this
17:29
<
rwmjones >
unfortunately my proposed language is context-sensitive on the current contents of the tree
17:29
<
bluestorm_ >
hm, seems rather non-trivial :p
17:29
<
rwmjones >
it actually is possible if I hack the generated .mli file
17:29
<
rwmjones >
eg. to add a reference to the tree to the .mly & .mli which I can then set in the lexer
17:30
<
rwmjones >
but I don't understand if that is going to break something deep
17:31
<
rwmjones >
if I just add (to the mly): let tree = ref [];; I can't see/update that in the lexer because of the generated parser.mli file. But if I add the signature to the parser.mli file by hand, then the lexer can set it at the start of the file
17:32
<
rwmjones >
& the parser commands can see/use/update the tree
17:33
ita has joined #ocaml
17:33
<
bluestorm_ >
that sounds like dark magic to me
17:34
<
bluestorm_ >
but as i don't know what you're really trying to do, and you must be the best one to find it out anyway... :p
17:34
<
rwmjones >
yes well the tree example is made up, but the problem that I'm trying to solve is real, for sure :-)
17:35
<
rwmjones >
but I could still imagine a tree language like:
17:35
<
rwmjones >
set node.attr = "foo";
17:35
<
rwmjones >
where 'node' would be the name of a node in an existing tree
17:35
<
rwmjones >
I'm not explaining this well ...
17:36
<
rwmjones >
I want to write a command line tool like this:
17:36
<
rwmjones >
$ transform tree.data commands > tree.data
17:36
<
rwmjones >
where commands is a list of commands to perform on the tree
17:36
<
rwmjones >
so if the existing tree just had a single root node called 'root'
17:37
<
rwmjones >
then a valid command would be
17:37
<
rwmjones >
set root.color = "blue";
17:37
<
rwmjones >
this command should fail if there is no node in the tree called 'root', but otherwise it should update the tree
17:37
smimou has quit ["bli"]
17:42
filp has quit ["Bye"]
18:09
l_a_m has quit [Remote closed the connection]
18:13
l_a_m has joined #ocaml
18:20
vpalle has quit [Read error: 113 (No route to host)]
18:29
Vital303 has joined #ocaml
18:30
CRathman has joined #ocaml
18:31
Torment has joined #ocaml
18:40
asmanur has quit [Remote closed the connection]
18:49
Jedai has quit [Read error: 110 (Connection timed out)]
18:53
ita has quit [Remote closed the connection]
19:09
buluca has joined #ocaml
19:13
filp has joined #ocaml
19:15
Vital303 has quit [Remote closed the connection]
19:20
Tetsuo has quit ["Leaving"]
19:20
ygrek_ has quit [Remote closed the connection]
19:20
Tetsuo has joined #ocaml
19:23
ygrek_ has joined #ocaml
19:39
bluestorm_ has quit ["Konversation terminated!"]
20:01
xavierbot has quit [Read error: 110 (Connection timed out)]
20:06
thesoko has joined #ocaml
20:20
filp has quit ["Bye"]
20:26
Mr_Awesome has quit [Read error: 110 (Connection timed out)]
20:35
piggybox has quit [Read error: 110 (Connection timed out)]
20:45
pango has quit [Remote closed the connection]
20:47
pango has joined #ocaml
20:48
Tetsuo has quit [Remote closed the connection]
21:04
Tetsuo has joined #ocaml
21:08
ygrek_ has quit [Remote closed the connection]
21:17
robozni has quit ["leaving"]
21:17
robozni has joined #ocaml
21:22
piggybox has joined #ocaml
21:42
Yoric[DT] has joined #ocaml
22:01
Tetsuo has quit ["Leaving"]
22:32
CRathman has quit ["ChatZilla 0.9.78.1 [Firefox 2.0.0.8/2007100816]"]
22:43
david_koontz has joined #ocaml
22:53
l_a_m has quit [Remote closed the connection]
23:32
Mr_Awesome has joined #ocaml
23:51
Yoric[DT] has quit ["Ex-Chat"]