Syntax error if paragraph contains more than 1 printable character

2023-12-12 Thread Steve Litt
Hi all, I'm creating a parser that takes a text file whose paragraphs are separated by blank lines. Unfortunately, if the input file contains a paragraph with more than one non-space character, it gives me a syntax error via yyerror(). So the following works, where = etc are not in the inpyut

Re: Syntax error if paragraph contains more than 1 printable character

2023-12-12 Thread Chris verBurg
Hey Steve, My reading of your code is that PARATEXT will only ever be a single character. I'm thinking you want the flex rule to be ".*" (etc) instead of just ".". I'm curious whether your paragraphs are allowed to contain NLs. If so, you're going to have to include them in the PARATEXT token v

Re: Solution to a Flex problem

2023-12-12 Thread Chris verBurg
Indeed - note that flex is more aligned with posix-style patterns than perl-style patterns, so it would rather have "[:space:]", and "\s" just means "s". -Chris On Tue, Dec 12, 2023 at 12:07 AM Steve Litt wrote: > Hi all, > > I know this is a Bison and not a Flex venue, but just in case somebod

Re: Syntax error if paragraph contains more than 1 printable character

2023-12-12 Thread Steve Litt
Thanks Chris, Changing "." to either ".*", ".+", "[^\n]*" or "[^\n]+" all solve the problem with multiple printables on one line, but still throw a syntax error when two lines follow each other without an intervening blankline. In other words, it calls a paragraph of more than one line a syntax er