当语法分析程序需要新符号时,它就调用扫描过程。
The syntax analyzer calls the scanner when it needs a new symbol.
若用词法和语法分析程序共同组成语言处理系统,其函数名、参数和返回值应一致。
If system of processing language is established with programs of lexical analysis and parsing, the function name, parameter and return value should be accordant.
这是因为我们决定明确允许使用Bison输出文件中的标准语法分析程序是不受限制的。
This is because we decided to explicitly permit the use of the Bison standard parser program in Bison output files without restriction.
举例来说,如果您简单地对所有源文件执行语法分析程序,那么您就可以确保源代码遵守预定义的编码标准。
For example, if you simply parse all of the source files for a program, you can ensure that the source code adheres to a predefined coding standard.
一些程序会由于技术原因而拷贝他们的某部分到输出——例如,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.
但我发现,在没有语法分析器的情况下,从我的应用程序生成那些事件还是合算的。
But I have found that it pays to generate those events from my application, without a parser.
语法分析器读取这棵树,并通过事件为应用程序描述它。
The parser reads the tree and describes it, through events, to your application.
这些特殊的翻译标记不仅向XML结构提供了逻辑组织,而且允许围绕xml语法分析器构建应用程序,以理解如何处理全球化数据。
These special translation tags not only lend a logical organization to the XML structure, they also allow an application built around an XML parser to understand how to process the globalized data.
在某些应用中,XML文档是仅由语法分析器建立的,而从不会由应用程序级代码建立,这是不相关的。
For certain USES where XML documents are built only by a parser, and never by application-level code, this is irrelevant.
本章集中讨论图1中的虚线-语法分析器和应用程序之间的接口或API(应用程序编程接口)。
This chapter concentrates on the dotted line in Figure 1 — the interface, or API (application Programming interface), between the parser and the application.
语法分析器,代表应用程序解码XML文件的软件组件。
The parser, a software component that decodes XML files on behalf of the application.
分层方法在应用程序逻辑和语法分析之间建立一个明显的分界。
The layered approach establishes a clean-cut separation between the application logic and the parsing.
该片段演示了如何将应用程序翻译处理与基本语法分析器功能相挂钩。
This fragment demonstrates how to hook your application-translation processing into the basic parser function.
清单2在清单1中所示的源代码中添加一个类,并在语法分析器中注册该错误处理程序。
Listing 2 adds a class to the source shown in Listing 1 and registers that error handler with the parser.
SAX是基于事件的API,这意味着,语法分析器在处理XML文件时会将事件-类似于 AWT 的事件-发送到应用程序。
SAX is an event-based API, meaning that the parser sends events -- similar to AWT events -- to your application as it progresses through the XML file.
一旦注册完毕,当语法分析器处理文档时,语法分析器就会通知所有分析事件的内容处理程序。
Once registered, the parser notifies the content handler of all parse events as the parser processes the document.
其结果就是他们的应用程序受困于某个特定的语法分析器 --有时甚至是某个语法分析器的特定版本。
The result is that they lock their applications into a specific parser -- sometimes a specific version of a parser.
这没什么不寻常的:sax语法分析器的级别很低,所以应用程序必须接管本来由DOM才能完成的大量工作。
It's not abnormal: the SAX parser is very low level, so the application has to take over a lot of the work that a DOM parser would do.
下列示例假设您已经使用了sax语法分析器,并且十分熟悉SAX应用程序的基本机制。
The following examples assume that you have use of a SAX parser and are familiar with the basic mechanisms of a SAX application.
接收SOAP响应时,客户机库对XML进行语法分析以获得方法调用的结果,并将结果传递给使用库的程序。
Upon receiving the SOAP response, the client library parses the XML to get the result of the method invocation and passes this result to the program using the library.
正如其名称所暗示的,基于事件的语法分析器将事件发送给应用程序。
As the name implies, an event-based parser sends events to the application.
的确,在第一种情况中,应用程序编写了XSLT处理器可以立即分析的XML文档(通常通过sax语法分析器)。
Indeed, in the first case, the application writes the XML document, which the XSLT processor immediately parses (often through a SAX parser).
通过单一调用进行实际的语法分析和文档构造,如果成功完成了这一操作,那么应用程序就可以检索并使用已构造的Document。
The actual parsing and document construction takes place with a single call, and if this completes successfully, the constructed document can then be retrieved and used by the application.
定义语法分析器类,应用程序员将定义一个'handler '类,该类将注册所使用的语法分析器。
Instead of defining a parser class, an application programmer defines a 'handler' class that is registered with whatever parser is used.
如果您还没有这一知识,则假设应用程序已经创建了sax语法分析器的实例以及能够实现or g . xml . sax .ContentHandler接口的类的实例。
If you don't have this knowledge, presume that the application has created an instance of the sax parser and an instance of a class that implements the org.xml.sax.ContentHandler interface.
在图2中,应用程序并没有写到文件中,而是直接调用处理器的ContentHandler,有效地模拟了语法分析器。
In Figure 2, instead of writing to a file, the application calls the processor's ContentHandler directly, effectively simulating the parser.
应用程序员将定义一个handler类,而不是语法分析器类,该handler类能注册到任何所使用的语法分析器中。
Instead of defining a parser class, an application programmer defines a handler class that is registered with whatever parser is used.
当它遇到第一个开始标记 <xbe:price-list> 时,语法分析器生成它的第二个事件来通知应用程序已经遇到了 price-list元素。
When it encounters the first opening tag, <xbe:price-list>, the parser generates its second event to notify the application that it has encountered the starting tag for a price-list element.
nparsedEntityDecl()通知应用程序已经发现了一个未经过语法分析的实体声明。
nparsedEntityDecl() notifies the application that an unparsed entity declaration has been found.
因为sax语法分析器已经可以解析大多数URL,所以很少应用程序实现EntityResolver。
Because the SAX parser can resolve most URLs already, few applications implement EntityResolver.
应用推荐