-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParser.java
More file actions
41 lines (34 loc) · 811 Bytes
/
Parser.java
File metadata and controls
41 lines (34 loc) · 811 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
30
31
32
33
34
35
36
37
38
39
40
41
import java.io.InputStream;
/**
* @author Cole Amick
* Date: 01.29.2014
*/
public class Parser {
private ParserRules rules;
/**
* Creates a parser that will use a file as input
* @param file - String
* @param logBit - boolean
*/
public Parser(String file, boolean logBit) {
rules = new ParserRules(file, logBit);
}
/**
* Creates a parser that will use a InputStream object as input
* @param inputStream - InputStream
* @param logBit - boolean
*/
public Parser(InputStream inputStream, boolean logBit) {
rules = new ParserRules(inputStream, logBit);
}
/**
* Starts the recursive descent parser that uses the lexical analyzer from project 1
*/
public void parse() {
try {
rules.startParse();
} catch (LexemeException e) {
//Intentionally left blank
}
}
}