Re: [sqlite] using lemon

2012-05-10 Thread Igmar Palsenberg


> Can anyone suggest a lexical scanner generator that:
> a) Works well with Lemon?
> b) Is also thread-safe (like Lemon)?
> 
> Does Flex work well with Lemon? (I think it is not thread-safe, but it is
> very popular and has plenty of examples around, which is also a plus for me)
> 
> I am trying to learn a little about writing tokenizers/parsers, and thought
> a */Lemon combo would be better to learn if I don't have any previous
> experience anyway than Flex/Bison.

I've used re2c recently. It should meet your needs, and worked well in my case. 
There is a lack of documentation,
but I've pot most issues I've ran into on my blog : 
http://www.palsenberg.com/development/working-with-re2c-lessons-learned

If you live up to those rules, live should be pleasant :)



Igmar
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Lemon and errors

2011-03-17 Thread Igmar Palsenberg
Hi,

I'm attempting to rewrite a buggy hand-written parser with a re2c / lemon one. 
I've ran into a strange thing (which is/was actually a bug in the lexer), but I 
can't determine why lemon finishes parsing, instead of throwing up a parser 
error.

The stripped-down parser :

[igmar@devel native]$ lemon -g parser.le 
// Reprint of input file "parser.le".
// Symbols:
//   0 $  4 CURLY_OPEN 8 start 12 identparam  
//   1 DOUBLE_QUOTE   5 CURLY_CLOSE9 groups  
//   2 STRING 6 SEMICOLON 10 group   
//   3 IDENTIFIER 7 error 11 identparams 
start ::= groups.
groups ::= groups group.
groups ::= group.
identparams ::= identparams identparam.
identparams ::= identparam.
identparam ::= DOUBLE_QUOTE STRING|IDENTIFIER DOUBLE_QUOTE.
identparam ::= STRING|IDENTIFIER.
group ::= IDENTIFIER identparams CURLY_OPEN CURLY_CLOSE SEMICOLON.
group ::= IDENTIFIER CURLY_OPEN CURLY_CLOSE SEMICOLON.

Should be fairly simple.

Input :

service transparent nntp {
};

acl telnet-service-acl {
};

I've put the tracelog on pastebin : http://pastebin.com/9FiUmd6a , can anyone 
en lighten me why the parser doesn't throw parser errors as I expect ?


Regards,


Igmar
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite on Windows 2003

2010-04-08 Thread Igmar Palsenberg

> Yeah, I think it is related to that. I am not new to ASP.NET nor to
> Windows 2003. I am new to SQLite, however.
> But I think you are on to something. I even changed the file name
> extension to .txt and it still doesn't work,
> although it does work in the console application.
>
To test : create a user with admin rights, and let IIS run under that 
user. See if that helps. If it does, you've got a permission problem. If 
it doesn'r, it's more complicated that a simple permission issue.


 Igmar
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite on Windows 2003

2010-04-08 Thread Igmar Palsenberg

> First of all, I want to thank everyone that has replied to this email
> thread.
>
> I still do not have a successful opening of the SQLite connection in my
> ASP.NET C# application on
> Windows 2003. I have done the following:
>
> The connection opens successfully with the SQLite command tool.
> It opens successfully using a C# console application.
> I have entered the following in my web.config:
>   
> I have installed SQLite on the server.
> I have entered the following in my web.config and machine.config:
>
>  
>
> description=".Net Framework Data  Provider for
> SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
>  
>
> I have re-cycled IIS many times.
> I have done everything suggested in the following link:
> http://sqlite.phxsoftware.com/forums/p/1391/6025.aspx
>
Just a wild guess : You're sure you're not getting bitten by the fact 
that IIS under more recent Windows version is (extremely) restricted in 
the sense in what it can do on the filesytem ?


 Igmar
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Computing day of week the using strftime() function - Feature or bug ?

2010-03-23 Thread Igmar Palsenberg
On 3/23/10 8:58 PM, Bernie Reiter wrote:
> Nico, thanks for your quick reply.
>
> I have copied the function strftime('%Y-%m-%d', ...) directly the sqlite 
> documentation
> and substituted the ... with my date string.
> Unfortunately, your advice doesn't seem to convince my Linux box,
> neither with a straight single quote nor with a "backwards leaning" single 
> quote
>
> [liveu...@localhost ~]$ SELECT strftime('%w','2010-03-21');
> bash: syntax error near unexpected token `('
>
>
> [liveu...@localhost ~]$ SELECT strftime('%w',`2010-03-21`);
> bash: syntax error near unexpected token `('
>
You're talking to bash, not sqlite.



 Igmar
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] [Lemon] Jump to %syntax_error

2010-02-22 Thread Igmar Palsenberg
Hi,

Can I somehow simulate a syntax error from within a rule action ? This 
parser looks up the token it receives, and I want to abort futher 
parsing in case that the lookup fails. as if there was a syntax error in 
the grammar.


Regards,


 Igmr
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Questions regarding Lemon

2010-02-22 Thread Igmar Palsenberg

> %type course_plot { std::vector* }
>
> course_plot(V) ::= COURSE_PLOT_BEG course_plot_sector(A) .
>   {
>
The issue is more what V is when the vector isn't created.


 Igmar
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Questions regarding Lemon

2010-02-22 Thread Igmar Palsenberg
Hi,

After a decode or so I've begun to program in C again. I've writing a 
parser, and Lemon seems like the right tool for the job. SQLite itself 
is an excellent read when starting with lemon.
However, a few questions remain unanswered :

- How do variables get initialized ? For example :

%type assigments { struct llist *}

assignments(A) ::= assignments assignment(B). { /* . */ }
assignments(A) ::= assignment(B). {/*  */ }

Can I assume that A, when the rule is executed the first time, is NULL ?

- What is the meaning of @ in an assignment ? From the sqlite parse.y 
source :

transtype(A) ::= DEFERRED(X).  {A = @X;}

Thanx in advance for all the hints :)


Regards,


 Igmar

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users