목차
Mini C를 Java로 구현.hwp
prime.mc
[TestComplier_Report]
[bin]
[src]
.classpath
.project
hs_err_pid4888.log
prime.mc
28.3KB
파일 11, 폴더 3
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
Mini C를 Java로 구현.hwp
1. Mini C 상태 전이도 작성
2. Mini C를 Java로 구현한 Source code
3. Java로 출력한 결과물
prime.mc
[TestComplier_Report]
[bin]
[src]
.classpath
.project
hs_err_pid4888.log
prime.mc
28.3KB
파일 11, 폴더 3
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
Mini C를 Java로 구현.hwp
1. Mini C 상태 전이도 작성
2. Mini C를 Java로 구현한 Source code
3. Java로 출력한 결과물
본문내용
Mini C를 Java로 구현.hwp
1. 상태 전이도 작성
≪ 그 림 ≫
2. Source code 구현(JAVA)
메인클래스
≪ 글 - 그림 파일 ≫
Scanner 클래스
≪ 글 - 그림 파일 ≫
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
Scanner.java
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import com.sun.org.apache.xpath.internal.compiler.Keywords;
public class Scanner {
static int NO_KEYWORDS = 11;
static int ID_LENGTH = 12;
int tnull = -1, tnot = 0, tnotequ = 1, tmod = 2, tmodAssign = 3, tident = 4, tnumber = 5;
int tand = 6 , tlparen = 7, trparen = 8, tmul = 9, tmulAssign = 10, tplus = 11;
int tinc = 12, taddAssign = 13,tcomma = 14, tminus = 15, tdec = 16, tsubAssign = 17;
int tdiv = 18, tdivAssign = 19,tsemicolon = 20,tless = 21, tlesse = 22,tassign = 23;
int tequal = 24,tgreat = 25, tgreate = 26, tlbracket = 27, trbracket = 28, teof = 29;
int tconst = 30,telse = 31, tif = 32, tint = 33, treturn = 34, tvoid = 35;
int twhile = 36,tlbrace = 37, tor = 38, trbrace = 39, tpersendsign = 40;
String keyword[] = {"const", "else", "if", "int", "return", "void", "while",
"lbrace", "tor" , "trbrace", "tpersendsign"};
/*
* Constructor
*/
Scanner(String filename) {
/*
* 읽을 파일명을 주지 않았을 때는 종료, args.length 는 옵션 개수
*/
if (filename.length() == 0) {
System.err.println("Input Filename...");
System.exit(1);
}
1. 상태 전이도 작성
≪ 그 림 ≫
2. Source code 구현(JAVA)
메인클래스
≪ 글 - 그림 파일 ≫
Scanner 클래스
≪ 글 - 그림 파일 ≫
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
Scanner.java
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import com.sun.org.apache.xpath.internal.compiler.Keywords;
public class Scanner {
static int NO_KEYWORDS = 11;
static int ID_LENGTH = 12;
int tnull = -1, tnot = 0, tnotequ = 1, tmod = 2, tmodAssign = 3, tident = 4, tnumber = 5;
int tand = 6 , tlparen = 7, trparen = 8, tmul = 9, tmulAssign = 10, tplus = 11;
int tinc = 12, taddAssign = 13,tcomma = 14, tminus = 15, tdec = 16, tsubAssign = 17;
int tdiv = 18, tdivAssign = 19,tsemicolon = 20,tless = 21, tlesse = 22,tassign = 23;
int tequal = 24,tgreat = 25, tgreate = 26, tlbracket = 27, trbracket = 28, teof = 29;
int tconst = 30,telse = 31, tif = 32, tint = 33, treturn = 34, tvoid = 35;
int twhile = 36,tlbrace = 37, tor = 38, trbrace = 39, tpersendsign = 40;
String keyword[] = {"const", "else", "if", "int", "return", "void", "while",
"lbrace", "tor" , "trbrace", "tpersendsign"};
/*
* Constructor
*/
Scanner(String filename) {
/*
* 읽을 파일명을 주지 않았을 때는 종료, args.length 는 옵션 개수
*/
if (filename.length() == 0) {
System.err.println("Input Filename...");
System.exit(1);
}
소개글