Product liability is a special liability for tort, which applies for "lex loci delicti as lex sausae" principle in private international law.
产品责任作为一种特殊的侵权责任,在传统上适用“侵权行为地法作为准据法”这一国际私法原则。
Lex: a lexical analyzer generator.
Lex:一个词汇分析器生成器。
Programs using yacc, but not lex, are rarer.
使用yacc而不使用lex的程序比较罕见。
This is where the UNIX lex and yacc tools are useful.
在这种情况下,UNIXlex和yacc工具就很有用处了。
Yacc files, like lex files, come in sections separated by % % markers.
类似于lex文件,yacc文件也是由使用% %标志隔开的部分构成。
For instance, code in many programming languages can be read using lex and yacc.
例如,可以使用lex和yacc读取很多编程语言的代码。
It consists of a series of rules that lex translates into the lexical analyzer.
它由一系列规则构成,lex将这些规则翻译为词汇分析器。
In this tutorial, you'll examine how to use lex and yacc, first to build a calculator.
在本教程中,首先您将研究如何使用lex和yacc来构建一个计算器。
Lex takes a specification file and builds a corresponding lexical analyzer, coded in c.
lex可以接受规范文件并构建一个相应的词汇分析器(用c编写的)。
Note that lex gives preference to longer matches, even if they're later. So, given these rules.
注意,lex优先选择更长的匹配,即使它们更靠后。
Here's a simple example of a program that can be written in a page of yacc and a half-page of lex code.
这里是一个简单的示例程序,只需要一页yacc代码和半页lex代码就可以编写完该程序。
In fact, while lex and yacc are almost always mentioned in the same breath, they can be used separately.
实际上,尽管lex和yacc几乎总是被同时提到,但是它们可以单独使用。
The first article will introduce lex and yacc in more general terms, exploring what they do and how they do it.
第一篇文章将使用更为通用的术语介绍lex和yacc,研究它们可以做什么以及怎样去做。
By using the lex and yacc tools, you can build a parsing engine that processes text according to specific rules.
通过使用lex和yacc工具,您可以构建一个分析引擎,根据特定的规则来处理文本。
However, if something can match either of two rules, order in the lex specification determines which one is used.
不过,如果有一些内容可以匹配两个规则中的任意一个,那么lex规范中的次序会决定使用哪一个规则。
Lex is a lexical analysis tool that can be used to identify specific text strings in a structured way from source text.
Lex是一种词法分析工具,它可以用来从源文本识别特定结构的文本字符串。
While lex can be used to generate sequences of tokens for a parser, it can also be used to perform simple input operations.
虽然可以用lex来为解析器生成记号序列,但也可以用它来执行简单的输入操作。
A number of very entertaining if trivial programs have been written entirely in lex (see Resources for links to those).
有很多非常有趣、完全用 lex编写的小程序(请参阅参考资料 中的链接)。
If something doesn't match any rules at all, lex will just copy it to standard output; this behavior is often undesirable.
如果有一些内容根本不匹配任何规则,那么lex将只是把它拷贝到标准输出;这种行为通常是不受欢迎的。
For example, some variables like yylineno (an undocumented lex scanner internal variable) might not be directly available on Linux by default.
例如,yylineno(一个不正式的lex扫描器内部变量)等某些变量默认情况下可能不能直接在Linux上使用。
It used to be that using multiple parsers within a single program required a fair amount of careful tuning of the files generated by lex and yacc.
以前,在一个程序中使用多个解析器时,需要非常小心地调整lex和yacc生成的文件。
Readers with some experience working with parsers will probably notice how similar this is to tokenizer generated by a "lex" style programming tool.
具有解析器实践经验的读者可能会注意到,这和由“lex”风格的编程工具生成的标记器是很相似的。
Their output is itself code, which needs to be fed into a compiler; typically, additional user code is added to use the code generated by lex and/or yacc.
它们的输出本身是代码,需要提供给编译器;通常,要增加另外 的用户代码来使用lex和/或 yacc生成的代码。
Conveniently, this has been corrected: modern versions of both lex and yacc allow you to specify a prefix to use on the names of symbols in generated code.
这一点已经得到了修正,而且更加便利:lex和yacc的最新版本都允许您在生成代码的符号名称上指定一个前缀。
The GNU versions of lex and yacc are flex and bison and, as with all things GNU, have excellent documentation including complete user manuals in a variety of formats.
lex和yacc的GNU版本是flex和bison,与所有的GNU软件一样,它们也都有非常好的文档,包括各种格式的完全用户手册。
A common problem is having a rule match too much text; worse, since lex prefers the longest match it can find, this can result in a totally inappropriate rule being matched.
常见的问题是,一个规则匹配太多的文本;更糟糕的是,由于lex倾向于匹配它能找到的最长的文本,这可能导致匹配的是一个完全不适当的规则。
Building on the ground we covered in part 1 of this two-part series, this article covers a couple of concrete applications of lex and yacc and discusses some common pitfalls.
在由两部分构成的系列文章的第1部分所涉及的内容基础之上,本文讨论了两个具体的lex和yacc应用程序,并讨论了一些常见的缺陷。
This can create a problem when porting code from one system to another: generally, you are best off re-running lex and yacc on a new platform, rather than porting the generated code.
当将代码从一个系统移植到另一个系统时,这会产生问题:通常,您最好在新的平台上重新运行lex和yacc,而不要移植生成的代码。
Using the calculator as an example, you'll further examine the output and information generated by the lex and yacc system and study how to use it to parse other types of information.
使用该计算器作为示例,您将进一步研究lex和yacc系统生成的输出和信息,并学习如何使用它来分析其他类型的信息。
A more powerful tool is exclusive states, in which only rules matching the exclusive state can be matched (this is not supported in all versions of lex, but should be available in anything modern).
更强大的工具是排他(exclusive)声明,在这个工具中,只有符合排他声明的规则才能被匹配(并不是所有的lex版本都支持这项功能,不过所有最新版本中都应该可以获得该功能)。
应用推荐