[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] Extending lengaje

From: Andy Chu
Subject: Re: [Help-bash] Extending lengaje
Date: Tue, 21 Aug 2018 08:27:44 -0700


grep yylex parse.y

Yacc generates a parser that calls the yylex() function, and in bash this
is directly in the parse.y file, not in a separate file.  It's written by
hand rather than generated by lex.

The bash parser is quite complicated -- if you want something similar in
Python you can look here:

$ scripts/ parser

gives an idea of where the code is.


On Tue, Aug 21, 2018 at 5:51 AM, Greg Wooledge <address@hidden> wrote:

> On Mon, Aug 20, 2018 at 08:42:04PM -0700, Azael Reyes wrote:
> > I'm experimenting with the code of bash to extend the input
> lenguaje(don't
> > going to obfuscate with detail because is a experiment), I found the
> > 'parse.y' file but I think need the lexical file, I'm expecting found
> some
> > file like 'lex.l' or something similar, but there is not somethink like
> > that.
> Bash doesn't use lex/flex during its build process.  It only uses bison
> (yacc alternative), in this part of the Makefile:
> parse.y
> #       -if test -f; then mv -f; fi
>         $(YACC) -d $(srcdir)/parse.y
>         touch parser-built
> #       -if cmp -s; then mv; else
> cp -p ${GRAM_H}; fi
>         @true
> Whatever you're looking for, it's in the parse.y file or it doesn't exist
> at all.  I suggest paying close attention to every part where the word
> "token" appears.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]