:: Re: [DNG] Studying C as told. (For …
Forside
Slet denne besked
Besvar denne besked
Skribent: KatolaZ
Dato:  
Til: dng
Emne: Re: [DNG] Studying C as told. (For help)
On Fri, Jul 08, 2016 at 06:26:35AM +0200, Edward Bartolo wrote:
> Hi,
>
> Since any grammar item has boundaries it makes sense for a syntax
> checker to pass boundaries to syntax checking functions. The first
> step would be to check the existence of an opening bracket and a
> closing bracket. If more brackets follow the process should be
> repeated.
>
> I think, this strategy should solve the problem with having multiple brackets.
>


Have you actually tried to implement that in your parser?

I am not asking because I want to be pedantic, but rather because this
is usually where parsing context-free languages becomes an enormous
error-prone mess, and is the reason why we have tools like lex/flex
and yacc/bison which take care of constructing the parser associated
to a set of productions on your behalf.

My2Cents

KatolaZ

-- 
[ ~.,_  Enzo Nicosia aka KatolaZ - GLUGCT -- Freaknet Medialab  ]  
[     "+.  katolaz [at] freaknet.org --- katolaz [at] yahoo.it  ]
[       @)   http://kalos.mine.nu ---  Devuan GNU + Linux User  ]
[     @@)  http://maths.qmul.ac.uk/~vnicosia --  GPG: 0B5F062F  ] 
[ (@@@)  Twitter: @KatolaZ - skype: katolaz -- github: KatolaZ  ]