-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTabela.java
More file actions
29 lines (22 loc) · 911 Bytes
/
Copy pathTabela.java
File metadata and controls
29 lines (22 loc) · 911 Bytes
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
public class Tabela
{
private static String simbolo = "(^*/+-)";
private static boolean[][] tabela =
{{false,false,false,false,false,false,true },
{false,true ,true ,true ,true ,true ,true },
{false,false,true ,true ,true ,true ,true },
{false,false,true ,true ,true ,true ,true },
{false,false,false,false,true ,true ,true },
{false,false,false,false,true ,true ,true },
{false,false,false,false,false,false,false}};
public static boolean isParaDesempilhar (char doTopo, char doStrTok) throws Exception
{
int lin=Tabela.simbolo.indexOf (doTopo);
if (lin==-1)
throw new Exception ("Char do topo invalido");
int col=Tabela.simbolo.indexOf (doStrTok);
if (col==-1)
throw new Exception ("Char pego do StringTokenizer invalido");
return Tabela.tabela[lin][col];
}
}