The label assigned to a constituent is the label of the root of the subtree. A constituent refers to a subtree in the parse tree and corresponds to a sequence of words in the sentence being parsed. Parse trees are represented as a collection of constituents to facilitate evaluation. Performance of parsing algorithms is evaluated using precision and recall measures on test data. Raghavan, in Handbook of Statistics, 2015 2.5.3 Evaluating Parsing Algorithms Assume that a is a vector of 100 elements (numbered 0–99) and that b and c are scalars. To see the difference between an AST and a three-address code, consider representing an assignment statement a ← b * c in each. Because programs expressed in three-address code must provide an explicit implementation for all of the source language's abstractions, this kind of IR is well suited to analyses and transformations that attack the overhead of implementing those abstractions. A typical three-address code represents some of the relevant features of the target machine, including a realistic memory model, branches and labels for changing the flow of control, and a specified evaluation order for all the expressions. Each operation has an operator, one or two input arguments, and a destination argument. It consists of a sequence of operations with an implicit order. Three-address code resembles the assembly code of a typical microprocessor. This makes it the IR of choice for analyses and transformations that are tied to source program structure, such as the high-level transformations discussed in Section VC. Because of its ties to the source-language syntax, an AST retains concise representations for most of the abstractions in the source language. It includes the important syntactic structure of the program while omitting any nonterminals that are not needed to understand that structure. The abstract syntax tree (AST) resembles the parse tree for the input program.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |