Programmatic approach — a specific parser program is written to parse each message format.
编程方法——编写特定的解析器程序来解析每种消息格式。
Descriptive approach — You write a single general-purpose model-driven parser program to parse all formats, with each message format represented by its own model.
描述方法——您将编写单个通用的模型驱动的解析器程序来解析所有格式,每种消息格式由各自的模型表示。
For example, if you have five different COBOL data structures, you write five format-specific parsers, with the format information hard-wired into the parser program code.
例如,如果您有五种不同的COBOL数据结构,您将编写五个特定于格式的解析器,并将格式信息硬编码到解析器程序代码中。
The disadvantage is lack of flexibility -- you must write a new parser program for each new format, and if a format changes, you must change, recompile, relink, and redeploy the parser program.
缺点在于缺乏灵活性——您必须为每种新的格式编写新的解析器程序,并且如果格式更改,您就必须更改、重新编译、重新链接和重新部署解析器程序。
Some programs copy parts of themselves into the output for technical reasons — for example, Bison copies a standard parser program into its output file.
一些程序会由于技术原因而拷贝他们的某部分到输出——例如,Bison拷贝一个标准的语法分析程序到它的输出文件。
Some programs copy parts of themselves into the output for technical reasons — for example, Bison copies a standard parser program into its output file.
一些程序会由于技术原因而拷贝他们的某部分到输出——例如,Bison拷贝一个标准的语法分析程序到它的输出文件。
应用推荐