|
Call-by-value:
Actual parameter is evaluated. It's value is placed in a the locating of the corresponding former parameter of the called procedure.
|
|
Call-by-reference:
Address of the actual parameter is passed to the value of the corresponding formal parameters. The expression is evaluated before the call, and its value is stored in a location of its own.
|
|
Token
token name and an optional attribute value.
|
|
Pattern
a description of the form that lexemes of a token may take.
|
|
Lexeme
sequence of characters in the source program that matches a pattern for the token and is identified by the lexical analyzer as an instance of that token.
|
|
Syntax:
of a programming language describes the proper form of its programs.
|
|
Semantics:
defines what its programs mean.
|
|
Grammar:
naturally describes the hierarchical structure of most programming languages.
|
|
Left-associative
Addition, subtraction, multiplication and division.
|
|
Right-associative
Exponentiation, "C" =
|
|
Done by attaching rules or program fragments to productions in grammars.
|
||
|
expr
|
->
|
expr1 + term
|
|
Sum of two subexpressions
|
||
|
In pseudo-code:
|
||
|
Translate
|
expr1;
|
|
|
Translate
|
term;
|
|
|
Handle
|
+;
|
|
|
1.Scanning
|
does not require tokenization.
|
|
2.Lexical Analysis
|
produces tokes from the output of the scanner.
|
|
The top-down construction of a parse tree is done by starting at the door, labelled with the starting nonterminal statement, and repeatedly parsing.
|
|
|
1.
|
At node N, labelled with a nonterminal A, select one of the productions for A and construct a children at N for the symbols in the production body.
|
|
2.
|
Find the next node at which a subtree is to be constructed, typically the leftmost unexpanded nonterminal of the tree.
|
|
Reads characters from input and groups them into "token objects." Along with a terminal symbol that is used for parsing decisions.
|
||
|
Token
|
->
|
Terminal + More Info.
|
|
General approach to reading ahead on the input.
|
Maintain an input buffer from which the lexical analyzer can read and push back characters.
|
|
|
RegEx ->
|
NFA
|
->DFA
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.