YACC

YACC

 英

  • 网络编译器(Yet Another Compiler Compiler);另一个编译器;分析器

例句

Yacc is a grammar parser; it reads text and can be used to turn a sequence of words into a structured format for processing.

Yacc一种语法分析可以读取文本用来单词序列转换便于处理结构化格式

This means that if yacc would have to read two tokens before it knew which action to take, it would be unable to parse this grammar.

意味如果yacc知道采取哪个动作之前必须读取两个标记那么无法解析语法

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 some cases, Yacc fails to produce a parser when given a set of specifications.

一些情况下给定一个规范集合Yacc生成词法分析器失败

Throughout these articles, the names "lex" and "yacc" will be used to include also flex and bison, the GNU versions of these utilities.

文章所有内容,“lexyacc名字代表包括这些工具GNU版本flexbison

Yacc allows you to refer to the components of an expression by symbolic names.

yacc允许通过符号引用表达式组成部分

This data type is a C union object, and is declared in the first section of a yacc file using a %union declaration.

这个数据类型一个Cunion对象yacc文件第一部分使用%union声明定义

The first section of a yacc file defines the objects that the parser will manipulate and generate.

yacc文件第一部分定义解析器将要处理生成对象

Normally we would use the compiler generator tools lex and yacc to build that part of the program which recognizes an arithmetic expression.

一般说来我们将要通过规定编译工具另外编译生成计算这个算术运算目标程式

Lex and yacc are a matched pair of tools.

lexyacc一对配对工具

Yacc provides a general tool for imposing structure on the input to a computer program.

Yacc提供一个通用工具识别程序输入结构

The general way this is done is to define a data type to contain objects that yacc will be manipulating.

通常解决问题方法定义一个容纳yacc将要处理对象数据类型

For instance, code in many programming languages can be read using lex and yacc.

例如可以使用lexyacc读取很多编程语言代码

Yacc is designed to work with the output of Lex, although you can write your own code to fill that gap.

yacc设计用来处理lex输出不过可以编写自己代码完成任务

Lex and yacc can be used to parse fairly simple and regular grammars.

lexyacc可以用来解析相当简单规则语法

One of the best things you can do to learn more about lex and yacc is to write a few toy programs.

为了深入学习lexyacc最好编写一些用来消遣程序

Yacc takes sets of tokens and assembles them into higher-level constructs, analogous to sentences.

yacc接受记号它们装配高层次结构类似句子

This is where yacc comes in: yacc lets you describe what you want to do with tokens. A yacc grammar tends to look sort of like this

就是yaccyacc可以描述希望怎样处理记号

Those tools we look at here do so, as does the popular compiler development tool YACC (and its variants).

我们这里研究工具这样流行编译开发工具YACC及其变体也是这样

Yacc files, like lex files, come in sections separated by %% markers.

类似lex文件yacc文件也是使用%%标志隔开部分构成

External DSLs build a new language grammar, requiring tools like lexx and yacc or Antlr.

外部DSLs构建一个语法构建需要使用lexxyaccAntlr工具

JavaCC, like YACC, is designed to speed the process of developing parser logic for languages.

JavaCCYACC一样加快语言解析器逻辑开发过程设计

Lex and yacc are very good at parsing reasonably simple file formats.

lexyacc非常擅长解析相当简单文件格式

Yacc then generates a function to control the input process.

Yacc生成一个函数控制输入过程

Yacc: This tool is standard on most UNIX operating systems.

Yacc这个工具大多数UNIX操作系统标准组件

This grammar is ambiguous; yacc can't figure out what's going on.

语法明确所以yacc无法指出接下来什么

Lex and yacc are tools for building programs.

lexyacc编译程序工具

The biggest limitation is that yacc is limited to one token of lookahead.

最大局限在于yacc限定一个预读标记

By using the lex and yacc tools, you can build a parsing engine that processes text according to specific rules.

通过使用lexyacc工具可以构建一个分析引擎根据特定规则处理文本

What are lex and yacc, and why do people refer to them together?

lexyacc什么为什么人们同时提及它们

In this tutorial, you'll examine how to use lex and yacc, first to build a calculator.

教程首先研究如何使用lexyacc构建一个计算器

Programs using yacc, but not lex, are rarer.

使用yacc使用lex程序比较罕见

In fact, while lex and yacc are almost always mentioned in the same breath, they can be used separately.

实际上尽管lexyacc几乎总是同时提到但是它们可以单独使用

This is where the UNIX lex and yacc tools are useful.

这种情况UNIXlexyacc工具用处

Most people never need to know what lex and yacc do.

大部分永远需要知道lexyacc可以什么

One thing you'll find if you play around a bit is that lex and yacc can be confusing to troubleshoot.

如果稍加研究发现lexyacc可以用于问题诊断

The code provided should work in all major versions, such as MKS yacc.

代码应该适用所有主流版本比如MKSyacc

While Yacc cannot handle all possible specifications, its power compares favorably with similar systems;

然而Yacc无法处理所有可能规范能力类似系统相比要好

When yacc is run with the -d option, it generates a header file defining constants. Thus, our earlier lex example using

使用-d选项运行yacc生成一个定义常量文件

Yacc would create a header file (called y. tab. h by default) containing a line something like

yacc创建包含类似下面一行文件默认y.tab.h)