grammar for propositional logic

2010-08-31 Thread Martin McDermott
I'm trying to write a simple grammar for propositional logic for a project of mine, with support for AND, OR, XOR, NOT. Nothing fancy, only I cant seem to come up with a correct grammar. My simple test cases all give me syntax errors. Anyone mind taking a look at it? Thanks Marty syntaxAnalyzer

Re: grammar for propositional logic

2010-08-31 Thread Martin McDermott
Know that feeling alright... On Wed, Sep 1, 2010 at 1:13 AM, Alfonso Urdaneta wrote: > On 9/1/10 1:01 AM, Martin McDermott wrote: > >> I'm trying to write a simple grammar for propositional logic for a project >> of mine, with support for AND, OR, XOR, NOT. Nothing fan

Re: grammar for propositional logic

2010-08-31 Thread Martin McDermott
Any comments on why I would be getting a syntax error? On Wed, Sep 1, 2010 at 1:50 AM, John P. Hartmann wrote: > -- Forwarded message -- > From: John P. Hartmann > Date: 1 September 2010 07:49 > Subject: Re: grammar for propositional logic > To: Martin McDer

Re: grammar for propositional logic

2010-09-01 Thread Martin McDermott
I hate to keep dragging this out but this isnt helping me very much. I now know that my syntax error is because of "unexpected $undefined, expecting $end or '\n'", but adding a newline to my test_file doesn't fix this issue. I'm not sure how my input does not conform to my grammar. Thanks everyon

Re: grammar for propositional logic

2010-09-01 Thread Martin McDermott
Flex doesn't give me any output and looking online it looks like whitespace wouldn't be causing this. For everything else I used the "." to have misc things printed out. So I'm not sure how thats possible or where its coming from. I attached the file in case anyone feels like taking a look. lexi

Re: grammar for propositional logic

2010-09-01 Thread Martin McDermott
h is why it doesn't tell you > anything. > > Assuming you don't care about whitespace, you need to split the rule > on line 39 into > > [ \t\r] ; > [\n] {lexEcho("%s", yytext); return yytext[0];} > > The default rule needs t