<palomer>
my parser handles left recursion better than right recursion
<palomer>
funky
<palomer>
not by much though
<Yoric[DT]>
:)
<palomer>
by 30%
* palomer
wonders if parsing 1500 tokens in 3 seconds is normal
<palomer>
with the rule A -> a | A a
<palomer>
damn you n^2 algorithm!
ygrek has joined #ocaml
ygrek has quit [Remote closed the connection]
ygrek has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
<palomer>
hrmph
<flux>
maybe now you know why parsers in general are less general than yours?-)
<palomer>
BUT, I figured out why it takes n^2
<palomer>
(it should really be n)
<palomer>
I need to be able to split a string in 2 in O(1)
<palomer>
think it's possible?
seafood has joined #ocaml
<flux>
by what criteria?
<palomer>
a regexp
<palomer>
I'm tokenizing while im parsing
<flux>
well, it must be atleast O(string length), right?
<flux>
how else would you match it
<palomer>
ah, righto
<palomer>
well, O(length of the string matched)
<flux>
and creating substrings is O(n) too, but you can work around that by referring to the original string and storing offsets
<flux>
but ocaml doesn't do that for you
<palomer>
yeah, I need to write my own string library
<flux>
then the batteries library is afaik going to include a ropes-based string library
<palomer>
and then my own regexp library to work on the strings
<palomer>
ropes based UTF8 regexp friendly library?
* palomer
salivates
<flux>
I don't know about regexp-friendliness, but perhaps so
<flux>
I remember pcre-dependency being discussed here, I don't know what the end result was
<palomer>
ropes means that indices are stored, right?
dobblego has joined #ocaml
<palomer>
O(1) concatenation!
<palomer>
sweet!
seafood has quit []
filp has joined #ocaml
seafood has joined #ocaml
jonafan_ has joined #ocaml
seafood has left #ocaml []
dobblego has quit ["Leaving"]
jonafan has quit [Read error: 110 (Connection timed out)]
koobe has quit [Read error: 104 (Connection reset by peer)]
<palomer>
weeeeeee
<palomer>
grrr, looks like I have to go cycle hunting
ygrek has quit [Remote closed the connection]
ygrek has joined #ocaml
seafood has joined #ocaml
<vixey>
take this tortoise and hare
jonafan has joined #ocaml
hkBst has joined #ocaml
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
jonafan_ has quit [Read error: 110 (Connection timed out)]
jonafan_ has joined #ocaml
OChameau has joined #ocaml
jonafan has quit [Read error: 110 (Connection timed out)]
jonafan has joined #ocaml
Yoric[DT] has joined #ocaml
petchema has quit [Remote closed the connection]
jonafan_ has quit [Read error: 110 (Connection timed out)]
jonafan_ has joined #ocaml
dobblego has joined #ocaml
jonafan has quit [Read error: 110 (Connection timed out)]
jonafan has joined #ocaml
dabblego has joined #ocaml
dobblego has quit [Nick collision from services.]
dabblego is now known as dobblego
jonafan_ has quit [Connection timed out]
vbmithr has joined #ocaml
Yoric[DT] has quit [Read error: 113 (No route to host)]
Snark_ has joined #ocaml
jonafan_ has joined #ocaml
Yoric[DT] has joined #ocaml
jonafan has quit [Read error: 110 (Connection timed out)]
jonafan has joined #ocaml
jonafan_ has quit [Read error: 110 (Connection timed out)]
dobblego has quit ["Leaving"]
jonafan_ has joined #ocaml
jonafan has quit [leguin.freenode.net irc.freenode.net]
vbmithr has quit [leguin.freenode.net irc.freenode.net]
Dzlk has quit [leguin.freenode.net irc.freenode.net]
netx has quit [leguin.freenode.net irc.freenode.net]
letrec has quit [leguin.freenode.net irc.freenode.net]
flux has quit [leguin.freenode.net irc.freenode.net]
unfo- has quit [leguin.freenode.net irc.freenode.net]
shortcircuit has quit [leguin.freenode.net irc.freenode.net]
flux has joined #ocaml
jonafan has joined #ocaml
bluestorm has joined #ocaml
vbmithr has joined #ocaml
Dzlk has joined #ocaml
netx has joined #ocaml
letrec has joined #ocaml
shortcircuit has joined #ocaml
unfo- has joined #ocaml
vbmithr has quit [Remote closed the connection]
vbmithr has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
jonafan_ has quit [Read error: 110 (Connection timed out)]
jonafan_ has joined #ocaml
LordMetroid has joined #ocaml
jonafan has quit [Read error: 110 (Connection timed out)]
jonafan has joined #ocaml
jonafan_ has quit [Read error: 110 (Connection timed out)]
LordMetroid has quit [Read error: 104 (Connection reset by peer)]
LordMetroid has joined #ocaml
Jedai has joined #ocaml
lordmetroid_ has joined #ocaml
lordmetroid_ has quit [Client Quit]
LordMetroid has quit [Connection timed out]
bluestorm has quit [Remote closed the connection]
bluestorm has joined #ocaml
petchema has joined #ocaml
AxleLonghorn has joined #ocaml
AxleLonghorn has left #ocaml []
RobertFischer has joined #ocaml
RobertFischer has quit []
RobertFischer has joined #ocaml
Snark_ has quit ["Ex-Chat"]
gim has quit [Read error: 104 (Connection reset by peer)]
gim has joined #ocaml
struk_atwork has quit [Read error: 104 (Connection reset by peer)]
TheLittlePrince has joined #ocaml
RobertFischer has quit []
seafood has quit []
delamarche has joined #ocaml
seafood has joined #ocaml
pango_ has quit [Remote closed the connection]
hcarty has quit [Remote closed the connection]
hcarty has joined #ocaml
OChameau-bis has joined #ocaml
OChameau has quit [Read error: 110 (Connection timed out)]
Smerdyakov has joined #ocaml
pango_ has joined #ocaml
Axioplase has joined #ocaml
vixey has quit ["* I'm too lame to read BitchX.doc *"]
delamarche has quit []
seafood has left #ocaml []
seafood has joined #ocaml
Linktim has joined #ocaml
LordMetroid has joined #ocaml
lordmetroid_ has joined #ocaml
lordmetroid_ has quit [Client Quit]
LordMetroid has quit [Client Quit]
LordMetroid has joined #ocaml
struk_atwork has joined #ocaml
vixey has joined #ocaml
filp has quit ["Bye"]
lordmetroid_ has joined #ocaml
lordmetroid_ has quit [Client Quit]
LordMetroid has quit [Connection timed out]
Axioplase has quit ["bbl"]
love-pingoo has joined #ocaml
filp has joined #ocaml
jarimatti has joined #ocaml
OChameau-bis has quit ["Leaving"]
TheLittlePrince has quit [Remote closed the connection]
khafra has joined #ocaml
blue_prawn has joined #ocaml
LordMetroid has joined #ocaml
<khafra>
So, I tried to make a regex, and it said it had a problem with my backslashes, so I added the Pcre library, and it still had a problem--even told me "Spurious \"
<hcarty>
khafra: You effectively have to double all of your \ characters in OCaml strings
<hcarty>
So rather than "\w+" you would use "\\w+"
<khafra>
Oh, ****. So, when the documentation says to use \(, I need to use \\\\(?
<bluestorm>
\\(
Axioplase has joined #ocaml
lordmetroid_ has joined #ocaml
<khafra>
Oh, right. For a literal backslash, would I put \\\ or \\\\? And is there any documentation more concise, and with more examples, than the admittedly large set of manpages that came with the module?
<pango_>
khafra: because it's correcct. The regexp engine only needs signle backslashes, it's the compiler that requires doubling backslashes in string litterals
<pango_>
at runtime the strings contain single backslashes
<hcarty>
khafra: A literal backslash would just be \\
<hcarty>
Nevermind - I think you meant in a regexp
<pango_>
(which is what the documentation is referring to)
<blue_prawn>
except from the top level
<blue_prawn>
# "\\" ;;
<blue_prawn>
- : string = "\\"
<pango_>
# String.length "\\" ;;
<pango_>
- : int = 1
Linktim_ has joined #ocaml
<pango_>
the toplevel quotes backslashes when displaying strings
<blue_prawn>
oh, ok :)
<khafra>
pango_: Ah, thanks. I'd like to use the ocaml interpreter to try this stuff out, but it doesn't support line editing over my ssh connection, which makes it slower than just compiling and trying.
<bluestorm>
khafra:
<bluestorm>
install rlwrap
<bluestorm>
or ledit
<khafra>
Google knows naught of rlwrap, but ledit may help, thanks--and do you know any pcre documentation resources? I couldn't tell, for instance, where to put the (?U) from the manpages until I saw it used, and I'm still not entirely sure about more complex cases.
<bluestorm>
khafra: apt-get may know rlwrap
<bluestorm>
or whatever package manager in use
LordMetroid has quit [Connection timed out]
Linktim has quit [Read error: 110 (Connection timed out)]