Thursday, March 24, 2016
Discuss the capabilities of CFG
12:59 PM
No comments
The capabilities of CFG :
Context free grammars are capable of describing most of the syntax of programming language. suitable grammars for expressions can often be constructed using associatively & precedence information. So, context free grammar are most useful in describing nested structures such as balanced parentheses, matching begin-end's, corresponding if-then-else's & so on. These nested structures cannot be described by regular expression. The following grammars the string, which serves the language.
Stat ...
What is CFG?Advantages of CFG
12:52 PM
No comments
Context Free Grammar : A CFG is a way of describing language by recursive rules. A CFG consists four tuples, denoted G = {V, T, P, S}
Where,
V = Finite set of variables. [Eg. {S, E}etc.]
T = Finite set of terminals. [Eg. {a, b, c,+}etc.]
P = Finite set of productions. [Eg. E E+E]
...
What is drawback of operator precedence parsing?
12:46 PM
No comments
Drawback of operator precedence parsing :
Difficult to find token from the operator precedence parsing.
It is itself tenuous. One can't always be sure the parser accepts exactly the desired language.
Only a small class of grammar can be using operator precedence techniques.
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SO...
What is Context Free Grammar With Example?
12:36 PM
No comments
Context Free Grammar : A CFG is a way of describing language by recursive rules. A CFG consists four tuples, denoted G = {V, T, P, S}
Where,
V = Finite set of variables. [Eg. {S, E}etc.]
T = Finite set of terminals. [Eg. {a, b, c,+}etc.]
P = Finite set of productions. [Eg. E E+E]
...
What are the differences between single pass & multi-pass compiler?
12:25 PM
No comments
The differences between single pass & multi-pass compiler :
Single Pass Compiler
Multi-Pass Compiler
1. Single pass compiler can be made to use more space than multi-pass compiler
1. Multi - pass compiler can be made to use less space than a single -pass compiler
2. Single pass compiler is faster than a multi -pass compiler
2. Multi - pass compiler is slower than a single pass compiler because each pass reads & writes an intermediate file.
...
Translate the expression -
11:55 AM
No comments
Translate the expression -
-(a+b)*(c+d)+(a+b+c) into (ii) Quadruples
At first we construct the three address code the above expression :
Three address code :
0) T1 : = a+b
1) T2 : = -T1
2) T3 : = c+d
3) T4 : = T2*T3
4) T5 : = a+b
5) T6 : = T5+c
6) T7 : = T4+T6
SL NO
OP
ARG1
ARG2
RESULT
(0)
+
a
b
T1
(1)
uminus
T1
-
T2
(2)
+
c
d
T3
...
Translate the following assignment statement A : = -B*(C+D) into three address, quadruple & triple forms
11:39 AM
No comments
Translate the following assignment statement A : = -B*(C+D) into three address, quadruple & triple forms
Here, given the expression - A: = -B*(C+D)
Three-address code :
T1 : = -B
T2 : = C+D
T3 : = T1+T2
A : = T3
These statement are represented by quadruples as shown in fig . (a)
SL NO
OP
ARG1
ARG2
RESULT
(0)
Uminus
B
-
T1
(1)
+
C
D
T2
...