浏览代码

flex: add page

Starbeamrainbowlabs 7 年之前
父节点
当前提交
e74e3ad12a
共有 1 个文件被更改,包括 16 次插入0 次删除
  1. 16 0
      pages/common/flex.md

+ 16 - 0
pages/common/flex.md

@@ -0,0 +1,16 @@
+# flex
+
+> Lexical analyser generator. Based on lex.
+> Given the specification for a lexical analyser, generates C code implementing it.
+
+- Generate an analyser from a flex file:
+
+`lex {{analyser.l}}`
+
+- Specify the output file:
+
+`lex {{analyser.l}} --outfile {{analyser.c}}`
+
+- Compile a C file generated by flex:
+
+`cc {{path/to/lex.yy.c}} --output {{executable}}`