YACC
美
英 
- 網(wǎng)絡(luò)編譯器(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是一種語法分析器,它可以讀取文本并用來將單詞序列轉(zhuǎn)換為便于處理的結(jié)構(gòu)化的格式。
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在知道采取哪個動作之前,必須讀取兩個標(biāo)記,那么它將無法解析該語法。
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.
一些情況下,當(dāng)給定一個規(guī)范集合時,Yacc生成詞法分析器會失敗。
Throughout these articles, the names "lex" and "yacc" will be used to include also flex and bison, the GNU versions of these utilities.
在這兩篇文章的所有內(nèi)容中,“lex”和“yacc”這兩個名字所代表的也包括這些工具的GNU版本flex和bison。
Yacc allows you to refer to the components of an expression by symbolic names.
yacc允許您通過符號名引用表達(dá)式的組成部分。
This data type is a C union object, and is declared in the first section of a yacc file using a %union declaration.
這個數(shù)據(jù)類型是一個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.
一般說來,我們將要通過規(guī)定的編譯工具和另外的某編譯器來生成能計(jì)算這個算術(shù)運(yùn)算的目標(biāo)程式。
Lex and yacc are a matched pair of tools.
lex和yacc是一對配對工具。
Yacc provides a general tool for imposing structure on the input to a computer program.
Yacc提供了一個通用工具來識別程序輸入的結(jié)構(gòu)。
The general way this is done is to define a data type to contain objects that yacc will be manipulating.
通常解決此問題的方法是定義一個容納yacc將要處理的對象的數(shù)據(jù)類型。
For instance, code in many programming languages can be read using lex and yacc.
例如,可以使用lex和yacc讀取很多編程語言的代碼。
Yacc is designed to work with the output of Lex, although you can write your own code to fill that gap.
yacc設(shè)計(jì)用來處理lex的輸出,不過您也可以編寫自己的代碼來完成此任務(wù)。
Lex and yacc can be used to parse fairly simple and regular grammars.
lex和yacc可以用來解析相當(dāng)簡單和規(guī)則的語法。
One of the best things you can do to learn more about lex and yacc is to write a few toy programs.
為了深入學(xué)習(xí)lex和yacc,您最好去編寫一些用來消遣的小程序。
Yacc takes sets of tokens and assembles them into higher-level constructs, analogous to sentences.
yacc接受成組的記號,并將它們裝配為高層次的結(jié)構(gòu),類似于句子。
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
這就是yacc要做的:yacc讓您可以描述希望怎樣處理記號。
Those tools we look at here do so, as does the popular compiler development tool YACC (and its variants).
我們在這里研究的工具是這樣做的,流行的編譯器開發(fā)工具YACC(及其變體)也是這樣做的。
Yacc files, like lex files, come in sections separated by %% markers.
類似于lex文件,yacc文件也是由使用%%標(biāo)志隔開的部分構(gòu)成。
External DSLs build a new language grammar, requiring tools like lexx and yacc or Antlr.
外部DSLs可構(gòu)建一個新語法,構(gòu)建時需要使用lexx和yacc或Antlr等工具。
JavaCC, like YACC, is designed to speed the process of developing parser logic for languages.
JavaCC與YACC一樣,是為加快語言解析器邏輯的開發(fā)過程而設(shè)計(jì)的。
Lex and yacc are very good at parsing reasonably simple file formats.
lex和yacc非常擅長解析相當(dāng)簡單的文件格式。
Yacc then generates a function to control the input process.
Yacc生成一個函數(shù)來控制輸入過程。
Yacc: This tool is standard on most UNIX operating systems.
Yacc:這個工具是大多數(shù)UNIX操作系統(tǒng)的標(biāo)準(zhǔn)組件。
This grammar is ambiguous; yacc can't figure out what's going on.
該語法是不明確的;所以yacc無法指出接下來將做什么。
Lex and yacc are tools for building programs.
lex和yacc是編譯程序的工具。
The biggest limitation is that yacc is limited to one token of lookahead.
最大的局限在于,yacc被限定為一個預(yù)讀標(biāo)記。
By using the lex and yacc tools, you can build a parsing engine that processes text according to specific rules.
通過使用lex和yacc工具,您可以構(gòu)建一個分析引擎,根據(jù)特定的規(guī)則來處理文本。
What are lex and yacc, and why do people refer to them together?
lex和yacc是什么,為什么人們同時提及它們?
In this tutorial, you'll examine how to use lex and yacc, first to build a calculator.
在本教程中,首先您將研究如何使用lex和yacc來構(gòu)建一個計(jì)算器。
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.
實(shí)際上,盡管lex和yacc幾乎總是被同時提到,但是它們可以單獨(dú)使用。
This is where the UNIX lex and yacc tools are useful.
在這種情況下,UNIXlex和yacc工具就很有用處了。
Most people never need to know what lex and yacc do.
大部分人永遠(yuǎn)不需要知道lex和yacc可以做什么。
One thing you'll find if you play around a bit is that lex and yacc can be confusing to troubleshoot.
如果稍加研究,您將發(fā)現(xiàn)lex和yacc可以用于問題診斷。
The code provided should work in all major versions, such as MKS yacc.
給出的代碼應(yīng)該適用于所有主流版本,比如MKSyacc。
While Yacc cannot handle all possible specifications, its power compares favorably with similar systems;
然而Yacc無法處理所有可能的規(guī)范,它的能力與類似的系統(tǒng)相比要好;
When yacc is run with the -d option, it generates a header file defining constants. Thus, our earlier lex example using
當(dāng)使用-d選項(xiàng)來運(yùn)行yacc時,它會生成一個定義常量的頭文件。
Yacc would create a header file (called y. tab. h by default) containing a line something like
yacc將創(chuàng)建包含有類似下面一行的一個頭文件(默認(rèn)名為y.tab.h)