UMUC Asia - CMSC430 - Theory of Language Translation
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]
開始行:
#contents
** Configuring A Linux Environment - Installing Cygwin fo...
+ Access to http://www.cygwin.com/install.html
+ Download and run setup-x86.exe
+ Select Root Intall Directory -> C:\cygwin
+ Select Local Package Directory -> C:\Users\username\Dow...
+ Select Internet Connection -> Direct Connection
+ Choose A Download Site -> choose a mirror site closer(...
+ Select Packages
- Devel (Cur)
-- Bin
--- binutils: GNU assembler, linker, and similar utilities
--- gcc-core: GNU Compiler Collection (C, OpenMP)
--- gettext: GNU Internationalization development utilities
--- mingw-gcc-core: GNU Compiler Collection (C, OpenMP)
--- mingw-gcc-core-g++: GNU Compiler Collection (C, OpenMP)
--- mingw-runtime: MinGW.org MSVC & compiler runtime head...
-- Bin/Src
--- bison: GNU yacc-compatible parser generator
--- flex: A fast lexical analyzer generator
--- gcc-g++: GNU Compiler Collection (C++)
--- make: The GNU version of the 'make' utility
- Resolving Dependencies -> Select required packages
- The installation is complete within 10 minutes
$ whereis gcc
gcc: /usr/bin/gcc.exe /usr/lib/gcc /usr/share/man/man1/g...
$ whereis bison
bison: /usr/src/bison-3.0.2-1.src/bison.cygport
$ whereis flex
flex: /usr/src/flex-2.5.39-1/flex.mknetrel /usr/src/flex...
$ whereis make
make: /usr/src/make-4.0-2/make.1 /usr/src/make-4.0-2/mak...
- Additional Packages
-- Editors
--- vim: VI IMproved - enhanced vi editor
--- vim-common: VI IMproved - enhanced vi editor (common ...
-- Net
--- bind: DNS server
--- curl: Multi-potocol file transfer tool
--- whois: GNU Whois
--- ping: A basic network tool to test IP network conecti...
-- Web
--- wget: Utility to retrieve files from the WWW via HTTP...
//** Introductions
//
//Hello class, my name is Yuji Shimojo and I'm 26. I am f...
//
//I have learned C, C++, Java, and CASL II in schools. In...
//
//In my spare time, I enjoy traveling. I've been to Calif...
//
//I also enjoy scuba diving. Okinawa is known as one of t...
** Week 1 Discussion [#ga621d0d]
- Question
Languages can be fully compiled, fully interpreted or par...
- Answer
I chose Java. When you run a Java program, your source co...
A major function of JVM is supporting garbage collection,...
- Professor's comment
What is the difference between the original JVMs and the ...
- My answer
Professor,
The original JVM was designed as an interpreter called th...
Using Java HotSpot VM is a hybrid approach between the in...
** Week 2 Discussion [#df1d8c3a]
- Question
Define some language using a regular expression. The lang...
There is a nice tool available for helping you understand...
** Week 2 Project 1 Discussion [#pd961c5c]
Be sure to read all the attached posts before beginning t...
In particular you should be sure to read the following th...
-- Project 1 Skeleton Code
-- Test Data for Project 1
-- Decoupling the Listing Code
** Week 2 Project 1 Skeleton Code [#ia483c18]
Project 1 involves writing the lexical analyzer for the c...
-- scanner.l http://nova.umuc.edu/~jarc/cmsc430/scanner.h...
-- tokens.h http://nova.umuc.edu/~jarc/cmsc430/tokens.html
-- makefile http://nova.umuc.edu/~jarc/cmsc430/makefile.h...
In addition, here are examples of how the outputs should ...
-- successful compilation http://nova.umuc.edu/~jarc/cmsc...
-- lexical error http://nova.umuc.edu/~jarc/cmsc430/failu...
** Week 2 Project 1 Decoupling the Listing Code [#t492c63b]
As a matter of good object-oriented design, it is a good ...
In the skeleton code that I have provided you I am callin...
Because, unlike Java, C++ does not require all functions ...
In the call to the appendError function I have passed in ...
enum ErrorType {LEXICAL, SYNTAX, SEMANTIC};
The listing.h file would be a good place to put this enum...
Finally, let me explain the purpose of the appendError fu...
** Week 2 Test Data for Project 1 [#oefbfbea]
Attached are the three test cases you should use for proj...
-- test1.txt(191 Bytes) https://learn.umuc.edu/d2l/le/473...
-- test2.txt(191 Bytes) https://learn.umuc.edu/d2l/le/473...
-- test3.txt(313 Bytes) https://learn.umuc.edu/d2l/le/473...
** Week 3 Discussion [#t6b8e619]
- Question
Define a language that is not a regular language using a ...
language must contain at least five characters. Describe ...
the language and demonstrate that it is in the language b...
tree that corresponds to the left-most derivation. Give a...
- Answer
My language:
A -> I = E
I -> E | x | y | z |
E -> E + T | T
T -> T * F | F
F -> ( E ) | I
The left-most derivation:
A -> I = E
-> x = E
-> x = E + T
-> x = T + T
-> x = F + T
-> x = ( E ) + T
-> x = ( T ) + T
-> x = ( T * F ) + T
-> x = ( F * F ) + T
-> x = ( I * F ) + T
-> x = ( x * F ) + T
-> x = ( x * I ) + T
-> x = ( x * y ) + T
-> x = ( x * y ) + F
-> x = ( x * y ) + ( E )
-> x = ( x * y ) + ( T )
-> x = ( x * y ) + ( T * F )
-> x = ( x * y ) + ( F * F )
-> x = ( x * y ) + ( ( E ) * F )
-> x = ( x * y ) + ( ( E + T ) * F )
-> x = ( x * y ) + ( ( T + T ) * F )
-> x = ( x * y ) + ( ( F + T ) * F )
-> x = ( x * y ) + ( ( I + T ) * F )
-> x = ( x * y ) + ( ( x + T ) * F )
-> x = ( x * y ) + ( ( x + F ) * F )
-> x = ( x * y ) + ( ( x + I ) * F )
-> x = ( x * y ) + ( ( x + y ) * F )
-> x = ( x * y ) + ( ( x + y ) * I )
-> x = ( x * y ) + ( ( x + y ) * z )
An example of one string that is not in the language:
x = ( a * b ) + ( ( x + y ) * z )
** Week 4 Project 2 Submit Files [#a858caa5]
The second project involves writing the syntactic analyze...
COLOR(red){program}:~
{COLOR(red){function}}
COLOR(red){function}:~
COLOR(blue){FUNCTION IDENTIFIER} [COLOR(red){parameters...
COLOR(red){parameters:}~
COLOR(red){parameter} {COLOR(blue){,} COLOR(red){parame...
COLOR(red){parameter:}~
COLOR(blue){IDENTIFIER} : COLOR(red){type}
COLOR(red){type}:~
COLOR(blue){INTEGER} | COLOR(blue){REAL} | COLOR(blue){...
COLOR(red){body}:~
{COLOR(red){variable}} COLOR(blue){BEGIN} COLOR(red){st...
COLOR(red){variable}:~
COLOR(blue){IDENTIFIER :} COLOR(red){type} COLOR(blue){...
COLOR(red){statement}:~
COLOR(red){expression} COLOR(blue){;} |~
COLOR(blue){IF} COLOR(red){expression} COLOR(blue){THEN...
COLOR(red){expression}:~
COLOR(blue){IDENTIFIER} |~
COLOR(blue){IDENTIFIER (}COLOR(red){expression} {COLOR(...
COLOR(blue){INT_LITERAL} | COLOR(blue){REAL_LITERAL} | ...
COLOR(blue){NOT} COLOR(red){expression} |~
COLOR(red){expression operator expression} |~
COLOR(blue){(}COLOR(red){expression}COLOR(blue){)}
COLOR(red){operator}: COLOR(blue){ADDOP} | COLOR(blue){MU...
In the above grammar, the red symbols are nonterminals, t...
The grammar must be rewritten to eliminate the EBNF brace...
The syntactic analyzer should be created using bison. It ...
Your parser should, however, be able to correctly parse a...
You will lose points from the design portion of your grad...
The 40 points that you will receive for the functionality...
Parses all syntactically correct programs 22 points
Detects and recovers from errors in the function header ...
Detects and recovers from errors in variable declarations...
Detects and recovers from errors in conditional expressio...
Detects and recovers from errors in arithmetic expression...
Detects and recovers from errors in the function body ...
Detects and recovers from multiple errors 3 points
Test data will be provide to test each of the above cases.
The next two phases of the project do not require that yo...
** [C++ for Java Programmers] Inheritance in C++ [#o0ff25...
Like Java, C++ is an object oriented language, however, t...
class Derived: public Base ...
It is important to specify the base class as public to en...
class Derived: public Base
{
public:
Derived(int value) : Base(value)
{ ...
C++ member functions (methods) are not bound dynamically ...
C++ has the equivalent of abstract methods, but they are ...
class Base
{
public:
virtual void abstract_method() = 0;
Interfaces can be created in C++, although C++ has no res...
** [C++ for Java Programmers] Separating the Interface fr...
Unlike, Java, which allows the complete class definition ...
void ClassName::functionName() ...
C++ does allow function bodies to be placed in the class ...
** [C++ for Java Programmers] Memory Allocation of Object...
Unlike Java, C++ does not allocate objects on the heap. B...
ClassName object;
The above declaration allocates space for that object on ...
It is sometimes necessary or preferable to dynamically al...
ClassName* objectPointer = new ClassName();
When we call a member function (method) of an object that...
** [C++ for Java Programmers] Managing Include Preprocess...
One of the greatest difficulties that Java programmers ha...
The simplest approach is to place all the include command...
Although this approach is the simplest, one drawback to t...
Another approach is to put include commands only in the s...
The final approach is to allow include commands in both s...
#define A_CLASS
#ifndef A_CLASS
The class definition
#endif
Many newer compilers provide a pragma for the approach, w...
#pragma once
This pragma has the same effect as using conditional comp...
You may choose whichever of these approaches that you pre...
終了行:
#contents
** Configuring A Linux Environment - Installing Cygwin fo...
+ Access to http://www.cygwin.com/install.html
+ Download and run setup-x86.exe
+ Select Root Intall Directory -> C:\cygwin
+ Select Local Package Directory -> C:\Users\username\Dow...
+ Select Internet Connection -> Direct Connection
+ Choose A Download Site -> choose a mirror site closer(...
+ Select Packages
- Devel (Cur)
-- Bin
--- binutils: GNU assembler, linker, and similar utilities
--- gcc-core: GNU Compiler Collection (C, OpenMP)
--- gettext: GNU Internationalization development utilities
--- mingw-gcc-core: GNU Compiler Collection (C, OpenMP)
--- mingw-gcc-core-g++: GNU Compiler Collection (C, OpenMP)
--- mingw-runtime: MinGW.org MSVC & compiler runtime head...
-- Bin/Src
--- bison: GNU yacc-compatible parser generator
--- flex: A fast lexical analyzer generator
--- gcc-g++: GNU Compiler Collection (C++)
--- make: The GNU version of the 'make' utility
- Resolving Dependencies -> Select required packages
- The installation is complete within 10 minutes
$ whereis gcc
gcc: /usr/bin/gcc.exe /usr/lib/gcc /usr/share/man/man1/g...
$ whereis bison
bison: /usr/src/bison-3.0.2-1.src/bison.cygport
$ whereis flex
flex: /usr/src/flex-2.5.39-1/flex.mknetrel /usr/src/flex...
$ whereis make
make: /usr/src/make-4.0-2/make.1 /usr/src/make-4.0-2/mak...
- Additional Packages
-- Editors
--- vim: VI IMproved - enhanced vi editor
--- vim-common: VI IMproved - enhanced vi editor (common ...
-- Net
--- bind: DNS server
--- curl: Multi-potocol file transfer tool
--- whois: GNU Whois
--- ping: A basic network tool to test IP network conecti...
-- Web
--- wget: Utility to retrieve files from the WWW via HTTP...
//** Introductions
//
//Hello class, my name is Yuji Shimojo and I'm 26. I am f...
//
//I have learned C, C++, Java, and CASL II in schools. In...
//
//In my spare time, I enjoy traveling. I've been to Calif...
//
//I also enjoy scuba diving. Okinawa is known as one of t...
** Week 1 Discussion [#ga621d0d]
- Question
Languages can be fully compiled, fully interpreted or par...
- Answer
I chose Java. When you run a Java program, your source co...
A major function of JVM is supporting garbage collection,...
- Professor's comment
What is the difference between the original JVMs and the ...
- My answer
Professor,
The original JVM was designed as an interpreter called th...
Using Java HotSpot VM is a hybrid approach between the in...
** Week 2 Discussion [#df1d8c3a]
- Question
Define some language using a regular expression. The lang...
There is a nice tool available for helping you understand...
** Week 2 Project 1 Discussion [#pd961c5c]
Be sure to read all the attached posts before beginning t...
In particular you should be sure to read the following th...
-- Project 1 Skeleton Code
-- Test Data for Project 1
-- Decoupling the Listing Code
** Week 2 Project 1 Skeleton Code [#ia483c18]
Project 1 involves writing the lexical analyzer for the c...
-- scanner.l http://nova.umuc.edu/~jarc/cmsc430/scanner.h...
-- tokens.h http://nova.umuc.edu/~jarc/cmsc430/tokens.html
-- makefile http://nova.umuc.edu/~jarc/cmsc430/makefile.h...
In addition, here are examples of how the outputs should ...
-- successful compilation http://nova.umuc.edu/~jarc/cmsc...
-- lexical error http://nova.umuc.edu/~jarc/cmsc430/failu...
** Week 2 Project 1 Decoupling the Listing Code [#t492c63b]
As a matter of good object-oriented design, it is a good ...
In the skeleton code that I have provided you I am callin...
Because, unlike Java, C++ does not require all functions ...
In the call to the appendError function I have passed in ...
enum ErrorType {LEXICAL, SYNTAX, SEMANTIC};
The listing.h file would be a good place to put this enum...
Finally, let me explain the purpose of the appendError fu...
** Week 2 Test Data for Project 1 [#oefbfbea]
Attached are the three test cases you should use for proj...
-- test1.txt(191 Bytes) https://learn.umuc.edu/d2l/le/473...
-- test2.txt(191 Bytes) https://learn.umuc.edu/d2l/le/473...
-- test3.txt(313 Bytes) https://learn.umuc.edu/d2l/le/473...
** Week 3 Discussion [#t6b8e619]
- Question
Define a language that is not a regular language using a ...
language must contain at least five characters. Describe ...
the language and demonstrate that it is in the language b...
tree that corresponds to the left-most derivation. Give a...
- Answer
My language:
A -> I = E
I -> E | x | y | z |
E -> E + T | T
T -> T * F | F
F -> ( E ) | I
The left-most derivation:
A -> I = E
-> x = E
-> x = E + T
-> x = T + T
-> x = F + T
-> x = ( E ) + T
-> x = ( T ) + T
-> x = ( T * F ) + T
-> x = ( F * F ) + T
-> x = ( I * F ) + T
-> x = ( x * F ) + T
-> x = ( x * I ) + T
-> x = ( x * y ) + T
-> x = ( x * y ) + F
-> x = ( x * y ) + ( E )
-> x = ( x * y ) + ( T )
-> x = ( x * y ) + ( T * F )
-> x = ( x * y ) + ( F * F )
-> x = ( x * y ) + ( ( E ) * F )
-> x = ( x * y ) + ( ( E + T ) * F )
-> x = ( x * y ) + ( ( T + T ) * F )
-> x = ( x * y ) + ( ( F + T ) * F )
-> x = ( x * y ) + ( ( I + T ) * F )
-> x = ( x * y ) + ( ( x + T ) * F )
-> x = ( x * y ) + ( ( x + F ) * F )
-> x = ( x * y ) + ( ( x + I ) * F )
-> x = ( x * y ) + ( ( x + y ) * F )
-> x = ( x * y ) + ( ( x + y ) * I )
-> x = ( x * y ) + ( ( x + y ) * z )
An example of one string that is not in the language:
x = ( a * b ) + ( ( x + y ) * z )
** Week 4 Project 2 Submit Files [#a858caa5]
The second project involves writing the syntactic analyze...
COLOR(red){program}:~
{COLOR(red){function}}
COLOR(red){function}:~
COLOR(blue){FUNCTION IDENTIFIER} [COLOR(red){parameters...
COLOR(red){parameters:}~
COLOR(red){parameter} {COLOR(blue){,} COLOR(red){parame...
COLOR(red){parameter:}~
COLOR(blue){IDENTIFIER} : COLOR(red){type}
COLOR(red){type}:~
COLOR(blue){INTEGER} | COLOR(blue){REAL} | COLOR(blue){...
COLOR(red){body}:~
{COLOR(red){variable}} COLOR(blue){BEGIN} COLOR(red){st...
COLOR(red){variable}:~
COLOR(blue){IDENTIFIER :} COLOR(red){type} COLOR(blue){...
COLOR(red){statement}:~
COLOR(red){expression} COLOR(blue){;} |~
COLOR(blue){IF} COLOR(red){expression} COLOR(blue){THEN...
COLOR(red){expression}:~
COLOR(blue){IDENTIFIER} |~
COLOR(blue){IDENTIFIER (}COLOR(red){expression} {COLOR(...
COLOR(blue){INT_LITERAL} | COLOR(blue){REAL_LITERAL} | ...
COLOR(blue){NOT} COLOR(red){expression} |~
COLOR(red){expression operator expression} |~
COLOR(blue){(}COLOR(red){expression}COLOR(blue){)}
COLOR(red){operator}: COLOR(blue){ADDOP} | COLOR(blue){MU...
In the above grammar, the red symbols are nonterminals, t...
The grammar must be rewritten to eliminate the EBNF brace...
The syntactic analyzer should be created using bison. It ...
Your parser should, however, be able to correctly parse a...
You will lose points from the design portion of your grad...
The 40 points that you will receive for the functionality...
Parses all syntactically correct programs 22 points
Detects and recovers from errors in the function header ...
Detects and recovers from errors in variable declarations...
Detects and recovers from errors in conditional expressio...
Detects and recovers from errors in arithmetic expression...
Detects and recovers from errors in the function body ...
Detects and recovers from multiple errors 3 points
Test data will be provide to test each of the above cases.
The next two phases of the project do not require that yo...
** [C++ for Java Programmers] Inheritance in C++ [#o0ff25...
Like Java, C++ is an object oriented language, however, t...
class Derived: public Base ...
It is important to specify the base class as public to en...
class Derived: public Base
{
public:
Derived(int value) : Base(value)
{ ...
C++ member functions (methods) are not bound dynamically ...
C++ has the equivalent of abstract methods, but they are ...
class Base
{
public:
virtual void abstract_method() = 0;
Interfaces can be created in C++, although C++ has no res...
** [C++ for Java Programmers] Separating the Interface fr...
Unlike, Java, which allows the complete class definition ...
void ClassName::functionName() ...
C++ does allow function bodies to be placed in the class ...
** [C++ for Java Programmers] Memory Allocation of Object...
Unlike Java, C++ does not allocate objects on the heap. B...
ClassName object;
The above declaration allocates space for that object on ...
It is sometimes necessary or preferable to dynamically al...
ClassName* objectPointer = new ClassName();
When we call a member function (method) of an object that...
** [C++ for Java Programmers] Managing Include Preprocess...
One of the greatest difficulties that Java programmers ha...
The simplest approach is to place all the include command...
Although this approach is the simplest, one drawback to t...
Another approach is to put include commands only in the s...
The final approach is to allow include commands in both s...
#define A_CLASS
#ifndef A_CLASS
The class definition
#endif
Many newer compilers provide a pragma for the approach, w...
#pragma once
This pragma has the same effect as using conditional comp...
You may choose whichever of these approaches that you pre...
ページ名: