-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsemanticErrorloc.txt
69 lines (47 loc) · 2.6 KB
/
semanticErrorloc.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Sematic Analyser:
------------------------------------------------
YE SAB BACHA HE ABHI::
1. input parameter overshadowing - done
2. while loop condition's variables must be assigned a value inside the loop
3. semantic.c:line 224 dynamic arrays ka assignement.
1.An identifier cannot be declared multiple times in the same scope.
processAST() symboltable.c
2.An identifier must be declared before its use.
saare function me independently kar rhe hai (typeExtractor.c)
checked
3.The types and the number of parameters returned by a function must be the same as that of the parameters used in invoking the function.
done in functionCallNode
checked
4.The parameters being returned by a function must be assigned a value. If a parameter does not get a value assigned within the function definition, it should be reported as an error.
done in semantic (use a bool field called isAssigned)
assgn node me iska code likna hai
5.The function that does not return any value, must be invoked appropriately.
done in semantic
checked
6.Function input parameters passed while invoking it should be of the same type as those used in the function definition.
done in semantic.c
checked
7.A switch statement with an integer typed identifier associated with it, can have case statement with case keyword followed by an integer only and the case statements must be followed by a default statement.
done in semantic.c
8.A switch statement with an identifier of type real is not valid and an error should be reported.
done in semantic.c
9.A switch statement with a boolean type identifier can have the case statements with labels true and false only. The switch statement then should not have a default statement.
done in sematic.c
10.Function overloading is not allowed.
done in symboltable.c
11.A function declaration for a function being used (say F1) by another (say F2) must precede the definition of the function using it(i.e. F2), only if the function definition of F1 does not precede the definition of F2.
done in functionCheck.c
12.If the function definition of F1 precedes function definition of F2(the one which uses F1), then the function declaration of F1 is redundant and is not valid.
done in functionCheck.c
13.A for statement must not redefine the variable that participates in the iterating over the range.
done in semantic.c
14.The function cannot be invoked recursively.
done in symboltable.c
15.An identifier used beyond its scope must be viewed as undefined
need to do everywhere almost
/*
var_demo_array 0
function2 1
function3 3
function4 4
*/