diff --git a/pages/common/lex.md b/pages/common/lex.md index cfa5621949..5c9e6ae537 100644 --- a/pages/common/lex.md +++ b/pages/common/lex.md @@ -10,8 +10,8 @@ - Specify the output file: -`lex {{analyzer.l}} --outfile {{analyzer.c}}` +`lex -t {{analyzer.l}} > {{analyzer.c}}` - Compile a C file generated by Lex: -`cc {{path/to/lex.yy.c}} --output {{executable}}` +`c99 {{path/to/lex.yy.c}} -o {{executable}}` diff --git a/pages/linux/lex.md b/pages/linux/lex.md new file mode 100644 index 0000000000..cfa5621949 --- /dev/null +++ b/pages/linux/lex.md @@ -0,0 +1,17 @@ +# lex + +> Lexical analyzer generator. +> Given the specification for a lexical analyzer, generates C code implementing it. +> More information: . + +- Generate an analyzer from a Lex file: + +`lex {{analyzer.l}}` + +- Specify the output file: + +`lex {{analyzer.l}} --outfile {{analyzer.c}}` + +- Compile a C file generated by Lex: + +`cc {{path/to/lex.yy.c}} --output {{executable}}` diff --git a/pages/osx/lex.md b/pages/osx/lex.md new file mode 100644 index 0000000000..8f005f4c91 --- /dev/null +++ b/pages/osx/lex.md @@ -0,0 +1,17 @@ +# lex + +> Lexical analyzer generator. +> Given the specification for a lexical analyzer, generates C code implementing it. +> More information: . + +- Generate an analyzer from a Lex file: + +`lex {{analyzer.l}}` + +- Specify the output file: + +`lex {{analyzer.l}} --outfile {{analyzer.c}}` + +- Compile a C file generated by Lex: + +`cc {{path/to/lex.yy.c}} --output {{executable}}`