Xây dựng bộ parser cho ngôn ngữ Wave

Một phần của tài liệu xây dựng bộ phân tích cú pháp chương trình (Trang 98 - 103)

i. Xóa bỏ tất cả các biến frontal, chuỗi wave liên quan tới track node này Xóa bỏ track node

5.3Xây dựng bộ parser cho ngôn ngữ Wave

Wave cũng giống như các ngôn ngữ khác, cũng bao gồm các đặc tả về Token, đặc tả cú pháp của ngôn ngữ. Dựa vào những phần trình bày bên trên, công việc chính cần làm đó là tạo ra file đặc tả cú pháp (jjt) của Wave.

Một phần file jjt của Wave:

options {

MULTI = true; VISITOR = true; }

PARSER_BEGIN(WAVEParser) package ast;

public class WAVEParser {

public static void main(String args[]) {

System.err.println("Reading a \"WAVEProgram\" from standard input...");

WAVEParser p = new WAVEParser(System.in); try {

SimpleNode wave = p.Wave(); wave.dump(" "); System.err.println("Thank you."); } catch (Exception e) { System.out.println("Oops."); System.out.println(e.getMessage()); e.printStackTrace(); } }

final public String WaveTail() { return m_waveTail;

}

private String m_waveTail; }

PARSER_END(WAVEParser) TOKEN: {

<INTEGER: (<DIGIT>)+>

| <STRING: "`" (~["`","\n","\r"])*"'"

| (["a"-"z","_"] (<LETTER> | <DIGIT>)*)> | <#LETTER: ["a"-"z","A"-"Z","_"]>

| <#DIGIT: ["0"-"9"]>

| <BRACKET: "{" (~["\n", "\r", "{", "}"])* "}"> }

WAVEProgram : Fa=1.Fa+1.T=Fa Zone : Fa=1 Sector : Fa=1 Assign : Fa=1 FrontalVar : Fa IntConst : 1 Zone : Fa+1 Sector : Fa+1 Sum : Fa+1 FrontalVar : Fa IntConst : 1 Zone : T=Fa Sector : T=Fa TerminalOutput : T=Fa FrontalVar : Fa

CHƯƠNG 6. TÀI LIỆU THAM KHẢO

TÀI LIỆU TIẾNG ANH

[1] Peter Sapaty, Mobile processing in Distributed and Open environments, 1998

[2] Bell, G., A. Parisi, and M. Pesce, The Virtual Reality Modelling Language: Version 1.0 Specification, November 9, 1995.

[3] Bruno, J., and S. M. Altman, “A Theory of Asychronous Control Networks,” IEEE Trans. Comput., Vol. C-20, No. 6, June 1971.

[4] Sapaty, P. S,. “Active Information Field as a Model for the Structural Solution of Task on Graphs and Networds,” Proc. USSR Academy of Sciences: Technical Cybernetics, No. 5, 1984 (in Russian).

[5] Varbanov, S., and P. S. Sapaty, “An Information System Based on the Wave Navigation Techniques,” Abstr. International Conference, AIMSA’86, Varna, Bulgaria, 1986.

[6] Sapaty, P.S., “The Wave-0 Language as a Framework of Navigational Structures for Knowledge Bases Using Semantic Networks,” Proc. USSR Academy of Sciences: Technical Cybernetics, No. 5, 1986 (in Russian).

[7] Borst, P., The First Implementation of the WAVE System for UNIX and TCP/IP Computer Networks, TR 18/92, Faculty of Informatics, University of Karlsrule. Karlsruhe, Germany, December 1992.

[8] Borst, P.M., H.-T Goetz, P. S. Sapaty, and W. Xorn, “Paralled Knowledge Processing in Open Networks,” Proc. International Conference and Exhibition “Hight- Perfor-mance Computing in Networks” (HPCN Europe ‘94), Munich, Germany, April 1994.

[9] Corbin M. J., and P. S. Sapaty, “Distributed Object-Based Simulation in Wave,” J. Simul. Pract. Theory, Vol. 3, No.3, pp. 157-181, 1995. (adsbygoogle = window.adsbygoogle || []).push({});

[10] Merchant F., L. F. Bic, P. M. Borst, M. J. Corbin, M. Dillencourt, M. Fukuda, and P. S. Sapaty, “Simulating Autonomous Objects in a S patial Database Using WAVE,” Proc. 9th European Simulation Multiconference, Prague, Czechoslovakia, June 1995.

[11] Livatharas, C., “Integration of Heterogeneous Databases Using WAVE,” M.Sc. Project Report, Department of Electrical Engineering, University of Surrey. Surrey, England, August 1995.

[12] Vuong, S., and I. Ivanov, “Mobile Intelligent Agent Systems: WAVE vs. JAVA,” Proc, etaCOM’96, Portland, Oreg., May 1996.

[13] Vuong, S., and L. Mathy, “Simulating the Mobile-IP Protocol Using Wave,” Proc, etaCOM’96, Porland, Oreg., May 1996.

[14] Darling, J. C. C., P.S Sapaty, and M. J. Underhill, “Distributed Virtual Reality: A Fully Dynamic Approach,” Proc. 15th Workshop on Standards for the Interoperability of Distributed Simulations, Institute for Simulation and Training, University of Central Florida, Orlando, Fla., September 1995.

[15] Tan, H. K. V,. “Distributed Dynamic 3D Virtual Reality,” M.Sc Telematics Diploma Project (base on WAVE), Department of Electrical Engineering, University of Surrey, Surrey, England, 1997.

WEBSITE THAM KHẢO

[16] http://www.java.com/en/ [17] https://javacc.dev.java.net/ [18] http://java.sun.com/ [19] http://www.alexa.com/ [20] http://www.everyday-wisdom.com/social-networking.html [21] http://en.wikipedia.org/wiki/Uniform_Resource_Locator [22] http://vi.wikipedia.org/wiki/M%E1%BA%A1ng_x%C3%A3_h %E1%BB%99i

Một phần của tài liệu xây dựng bộ phân tích cú pháp chương trình (Trang 98 - 103)