00:08
KrispyKringle is now known as GorzoTheMighty
00:11
GorzoTheMighty is now known as KrispyKringle
00:15
__DL__ has quit [Remote closed the connection]
00:35
humasect has quit [Read error: 110 (Connection timed out)]
00:48
Bigbang is now known as Bigb[a]ng
00:48
humasect has joined #ocaml
00:49
zigong has quit [Remote closed the connection]
00:53
tristram has quit [Remote closed the connection]
00:54
tristram has joined #ocaml
01:01
Skal has quit ["Client exiting"]
01:02
KrispyKringle is now known as KrispyKreme
01:11
humasect has quit [Read error: 110 (Connection timed out)]
01:12
smimou has quit ["bli"]
01:35
Skal has joined #ocaml
01:35
Skal has quit [Remote closed the connection]
01:41
malc_ has quit ["leaving"]
01:43
Raziel has quit ["Yo soy goma. Tú eres cola."]
01:54
Raziel has joined #ocaml
01:55
Raziel has quit [Client Quit]
01:55
Raziel has joined #ocaml
02:06
vodka-goo has quit ["Connection reset by by pear"]
02:09
rillig has quit ["exit(EXIT_SUCCESS)"]
02:17
HotNoodleOfInqui has joined #ocaml
02:18
quamaretto has quit ["bye"]
02:22
Revision17 has joined #ocaml
02:23
HotNoodleOfInqui has left #ocaml []
02:23
quamaretto has joined #ocaml
02:52
sebell has joined #ocaml
03:00
Snark has joined #ocaml
03:01
pango_ has joined #ocaml
03:07
sebell has left #ocaml []
03:18
pango has quit [Read error: 110 (Connection timed out)]
05:07
ramkrsna has quit [Remote closed the connection]
05:41
KrispyKreme is now known as KrispyKringle
05:56
Smerdyakov has quit ["Leaving"]
06:59
kryptt has joined #ocaml
07:41
Schmurtz has quit [Read error: 113 (No route to host)]
08:04
Schmurtz has joined #ocaml
08:04
Schmurtz has quit [Client Quit]
08:37
ramkrsna has joined #ocaml
08:52
ramkrsna has quit [Read error: 104 (Connection reset by peer)]
08:54
pango_ has quit [Remote closed the connection]
09:00
_fab has joined #ocaml
09:03
bluestorm has joined #ocaml
09:03
bluestorm has quit [Client Quit]
09:03
bluestorm has joined #ocaml
09:05
Submarine has joined #ocaml
09:06
pango has joined #ocaml
09:08
bluestorm has quit [Client Quit]
09:08
bluestorm has joined #ocaml
09:11
ramkrsna has joined #ocaml
09:13
ski has quit [Remote closed the connection]
09:17
ski has joined #ocaml
09:20
m3ga has joined #ocaml
09:28
ski has quit [Remote closed the connection]
09:30
ski has joined #ocaml
10:04
revision17_ has joined #ocaml
10:09
Skal has joined #ocaml
10:17
Revision17 has quit [Read error: 110 (Connection timed out)]
10:21
Schmurtz has joined #ocaml
10:32
Bigb[a]ng is now known as Bigbang
10:53
Amorphous has quit [Read error: 110 (Connection timed out)]
10:55
Schmurtz has quit [Read error: 113 (No route to host)]
11:01
Amorphous has joined #ocaml
11:20
bluestorm has quit ["Leaving"]
11:20
kenpex has joined #ocaml
11:21
bluestorm has joined #ocaml
11:22
Schmurtz has joined #ocaml
11:24
Submarine has quit [Remote closed the connection]
11:38
m3ga has quit [Read error: 104 (Connection reset by peer)]
11:40
malc_ has joined #ocaml
12:15
Raziel has quit [Remote closed the connection]
12:27
gim has joined #ocaml
12:43
bzzbzz has quit ["leaving"]
12:52
bluestorm has quit [Remote closed the connection]
13:19
kryptt has quit [Read error: 110 (Connection timed out)]
14:01
Skal has quit [niven.freenode.net irc.freenode.net]
14:01
pango has quit [niven.freenode.net irc.freenode.net]
14:01
noj has quit [niven.freenode.net irc.freenode.net]
14:16
pango has joined #ocaml
14:19
Skal has joined #ocaml
14:32
batdog has quit [Remote closed the connection]
14:33
batdog|gone has joined #ocaml
14:35
batdog|gone has quit [Remote closed the connection]
14:35
batdog|gone has joined #ocaml
14:37
batdog|gone has quit [Remote closed the connection]
14:38
batdog has joined #ocaml
15:13
quamaretto has quit [Nick collision from services.]
15:13
HotNoodleOfInqui has joined #ocaml
15:21
bluestorm has joined #ocaml
16:00
exa has joined #ocaml
16:00
_fab has quit [Read error: 104 (Connection reset by peer)]
16:16
_fab has joined #ocaml
16:19
ski_ has joined #ocaml
16:21
ski has quit [Nick collision from services.]
16:21
ski_ is now known as ski
16:22
_fab has quit [Read error: 113 (No route to host)]
16:37
_fab has joined #ocaml
16:38
Smerdyakov has joined #ocaml
17:02
bluestorm has quit [Remote closed the connection]
17:09
vincenz has quit ["Lost terminal"]
17:11
vincenz has joined #ocaml
17:18
gim has quit [Remote closed the connection]
17:21
_JusSx_ has joined #ocaml
17:21
<
_JusSx_ >
HI OCAML ppl
18:11
Smerdyakov has quit [Read error: 101 (Network is unreachable)]
18:31
ski_ has joined #ocaml
18:33
ski has quit [Nick collision from services.]
18:33
ski_ is now known as ski
18:45
zigong has joined #ocaml
18:58
vodka-goo has joined #ocaml
19:29
smimou has joined #ocaml
19:40
jave has joined #ocaml
19:44
simon has joined #ocaml
19:45
<
simon >
what are the ocaml equivalents to the is*() of ctype.h in C? (isapha, ispunct, etc.)
19:47
<
smimou >
there is no equivalent
19:47
<
vodka-goo >
simon: you can use regexp
19:47
<
smimou >
you can either do it by hand or use regexp
19:47
<
simon >
vodka-goo, rather than a set of character comparisons? I'd rather not.
19:47
<
malc_ >
what an idiotic advice
19:47
<
simon >
smimou, I'll just make it myself then.
19:48
<
smimou >
yes for a char a regexp is a bit of an overkill
19:48
<
vodka-goo >
simon: OK tell us what you want to do exactly
19:48
<
vodka-goo >
we'll be able to make a more precise answer
19:48
<
simon >
vodka-goo, isalpha(c)
19:48
<
vodka-goo >
simon: use pattern matching
19:48
<
smimou >
simon: but things like (c >= 'a' && c <= 'z') should work
19:48
<
vodka-goo >
match c with 'a'..'z' | 'A'..'Z' -> true | _ -> false
19:48
<
malc_ >
no they will not
19:49
<
malc_ >
isXX is locale aware
19:49
<
malc_ >
these hacks aren't
19:49
<
simon >
malc_, so is* do exist, or are you referring to the C ones?
19:49
<
vodka-goo >
for good locale aware code, we should check for a binding
19:50
<
vodka-goo >
maybe it's done in extlib ?
19:50
<
smimou >
extlib is a pure caml lib
19:50
<
vodka-goo >
it can still be good ;)
19:56
<
vodka-goo >
if you like the unicode solution, camomile is the lib for unicode in caml
20:11
Bigbang is now known as Bigb[a]ng
20:34
<
simon >
oops, wrong keyboard layout.
20:43
<
simon >
when you do nested matching using 'match', how do you define which 'match' paragraph your '| pattern' is relative to?
20:44
<
malc_ >
explicit blocking
20:44
<
malc_ >
with () or begin end
20:44
<
simon >
ah. thanks.
20:51
zigong has quit [Remote closed the connection]
21:03
_JusSx_ has quit ["leaving"]
21:16
_JusSx_ has joined #ocaml
21:19
Snark has quit [Read error: 110 (Connection timed out)]
21:26
rillig has joined #ocaml
21:38
malc__ has joined #ocaml
21:44
malc_ has quit [Read error: 110 (Connection timed out)]
22:29
Mitar has joined #ocaml
22:32
Smerdyakov has joined #ocaml
22:40
thei0s has joined #ocaml
22:41
thei0s has quit ["Jetzt stehst du da.. an der Laterne.. hast Tränen im gesicht.."]
22:53
_fab has quit [Read error: 104 (Connection reset by peer)]
23:11
pango has quit ["Leaving"]
23:12
_fab has joined #ocaml
23:14
Mitar has left #ocaml []
23:16
Axioplase has joined #ocaml
23:17
<
Axioplase >
Does anyone have some knowledge about ocamllex and ocamlyacc?
23:17
<
vodka-goo >
yup, try your question
23:18
kenpex has quit ["[In Me I Trust]"]
23:18
<
Axioplase >
I'm trying to write a brainfuck intrepreter or compiler. I know that I might have a lot of "+" together, so I tought I could do '+'+ { INCR (String.lentgh (lxm) ) }
23:19
<
Axioplase >
and then, do the "+" action as many times as the legnth of that string.
23:19
<
Axioplase >
But when it comes to yacc, I don't know how to write "do this action N times" (nor do I know how to get this number)
23:20
<
Axioplase >
in other (non caml) words, if "i++;" means "increment i", then I want to make "i++;i++;i++;" become "i=i+3"
23:21
<
Axioplase >
(there's no link between, the exmaple "+" and the one I parse, but I think you get what I mean)
23:22
malc__ has quit [Read error: 110 (Connection timed out)]
23:24
<
vodka-goo >
you have a token INCR of int
23:25
<
vodka-goo >
in yacc it will be seen as a single token, so only one action will be performed
23:25
<
Axioplase >
So I'd still better treat each INCR individually ?
23:25
<
vodka-goo >
paste some code so I can get the approach you're using
23:25
Raziel has joined #ocaml
23:26
<
Axioplase >
some lexx/yacc code ? or some brainfuck code ?
23:26
<
vodka-goo >
Axioplase: I don't know brainfuck and I don't know your code, but I think one action INCR { incr $1 } can be OK
23:26
<
vodka-goo >
Axioplase: your parser
23:28
<
Axioplase >
I think I remember how parsing works...
23:29
<
Axioplase >
I need to create my tree sum type.
23:29
_JusSx_ has quit [Remote closed the connection]
23:30
pango has joined #ocaml
23:31
<
vodka-goo >
Axioplase: depends.. some simple parsers can only perform side effects, return unit
23:32
<
vodka-goo >
for an interpreter it can be enough
23:32
<
vodka-goo >
for a compiler you should build a tree
23:32
<
Axioplase >
hum.. I guess I want to return the tree, so that I can evalueate it with some other code (or compile it to another language)
23:32
<
vodka-goo >
it's more modular yes
23:33
<
Axioplase >
"Who does the most, can do the least" (litteral translation from a proverb from here)
23:35
<
Axioplase >
I just need you to remind me how the parser stops and returns then. (so that I have NOP that will end the parsing?)
23:41
<
vodka-goo >
the "stop" is when the start rule has been recognized
23:42
<
vodka-goo >
the value of the associated action is what is returned
23:42
<
vodka-goo >
I think you need a simple example of parser
23:42
lispy has quit [Read error: 110 (Connection timed out)]
23:42
<
Axioplase >
I might think that too :)
23:43
<
vodka-goo >
don't mind the name ;)
23:43
<
vodka-goo >
it's a simple parser, I hope it'll help you figure out how you can design yours
23:43
<
vodka-goo >
examples can be more efficient than explanations
23:45
<
Axioplase >
Don't I have to define the constructors in the parser ?
23:46
<
vodka-goo >
Axioplase: the token type is defined implicitely from the %token declarations
23:48
<
Axioplase >
afair I had to write them down, but I may be wrong.
23:50
<
vodka-goo >
maybe you're thinking about the type of the tree you're building
23:50
<
vodka-goo >
which needs to be declared
23:50
<
vodka-goo >
contrary to the type of tokens read by the parser (output by the lexer)
23:52
<
Axioplase >
I'm think of the {Cons($1,$3)} <-- the "Cons". The sume type must be defined in the paser, doesn't it?
23:52
<
vodka-goo >
you're right
23:56
<
Axioplase >
hum... do you have an example file that passes some value with the lexem? (to see how it is read from in the parser)
23:58
<
vodka-goo >
in the same webCVS you can read the associated lexer
23:58
smimou has quit ["bli"]
23:58
<
vodka-goo >
and I've posted a link to the file where I use the lexer together with the parser
23:59
<
Axioplase >
ha. Hadn't seen the toplevel