I've installed Lex Flex Yacc Bison extension in Visual Studio Code, created a sample project, navigated to folder in the terminal, but when I run yacc -d syntax.y
, the terminal doesn't recognize the yacc
command. line 1 begins with %{
. The only command that seems to work is ls
to list the files in the current directory.
yacc : The term 'yacc' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At line:1 char:1
+ yacc -d syntax.y
+ ~~~~
+ CategoryInfo : ObjectNotFound: (Yacc:String) [],
CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
The Lex Flex Yacc Bison extension only provides syntax highlighting for the input files to these tools; it does not include the tools themselves.
On Windows, probably the easiest way to get them is to install Cygwin. Cygwin has flex
, yacc
, and bison
. Cygwin does not have a port of lex
. I recommend using flex
for lexical analysis and bison
for grammatical analysis, since those are the actively mantained successors of lex
and yacc
.