-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomment!
More file actions
51 lines (51 loc) · 1.43 KB
/
comment!
File metadata and controls
51 lines (51 loc) · 1.43 KB
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
private static boolean ClassDecl()
{
getInput();
if(input.equals("identifier")){
getInput();
if(input.equals("{")){
getInput();
if(input.equals("int") || input.equals("float") || input.equals("char"))//first(VarDecl)
{
while(VarDecl()){
if(!(input.equals("int") || input.equals("float") || input.equals("char")))
break;
}
}
else//ta akhare class bekhun rad kon!!
{
while(!input.equals("}") && !isFollow("ClassDecl",input))//ya follow(class)
{
getInput();
}
}
if(input.equals("}")){
getInput();
return true;
}
else
{
error("not matching {} in line"+token.getLine()+"an col"+token.getCol());
return true;
}
}
else
{
error("lost { in line"+token.getLine()+"an col"+token.getCol());
while(!isFollow("ClassDecl",input))
{
getInput();
}
return true;
}
}
else
{
error("enter identifier in line" + token.getLine() + " and col" + token.getCol());
while(!isFollow("ClassDecl",input))
{
getInput();
}
return true;
}
}