Updated docs for 300 and fixed bug with lexing non-supported specials

svn: r1562
This commit is contained in:
Kathy Gray 2005-12-07 22:00:15 +00:00
parent e54514d4be
commit d4a450a93b
7 changed files with 58 additions and 78 deletions

View File

@ -1,19 +1,39 @@
_professorj_
This documentation details available resources, recent additions, and
constructs which do not currently work in ProfessorJ overall. For
details of the specific language levels, please see the language level
specific manuals.
ProfessorJ is a compiler for Java and related languages. The languages
include three teaching languages, Java 1.1 (with some incomplete
features, see below), and an experimental language supporting interoperability
between Java and Scheme. For details about the teaching languages, please
see the language manuals.
The interactions window accepts variable declaration, statements and
expressions legal for the language level. If the text is not sending,
type Alt+Enter.
In all of the ProfessorJ language levels, the interactions window accepts variable
declaration, statements and expressions legal for the language level. If the text
is not sending, type Alt+Enter to force the text to send.
The definitions window expects class and interface definitions,
interaction boxes, and test-suite boxes. (i.e. what would be given to
Java examples boxes, and test suite boxes. (i.e. what would be given to
javac plus two graphical boxes). Descriptions of these boxes can be
found in the DrScheme manual.
_ProfessorJ Beginner
In Version 300, the Beginner language level has undergone significant changes.
Largest among these is that interfaces are supported within the language, but
abstract classes are no longer allowed. Further, interface implementation is supported
but class extension is not. For further details please see the language manual.
_ProfessorJ Intermediate
In Version 300, instanceof is now allowed. For further language details please see
the language manual.
_ProfessorJ Advanced
For details, please see the language manual.
_ProfessorJ Full
Supports Java 1.1, no 1.5 features have been included. Few libraries are available.
Where the libraries are supported, they are from version 1.4 (there are no language
differences between 1.1 and 1.4). Please see the list of unsupported features to see
what constructs are not available within this language level.
_Java + dynamic_ language level
Version 299.200 +
This language level allows programs to contain a value that will be
@ -72,23 +92,21 @@ _Java + dynamic_ language level
_Libraries available to ProfessorJ:
*NEW* Items are new to either DrScheme 207 or DrScheme 208
java.lang.Object
java.lang.String (see exceptions)
java.lang.Throwable
java.lang.*Exception
*NEW* java.lang.System (only currentTimeMillis, gc, and identityHashCode)
*NEW* java.lang.Comparable
*NEW* java.lang.Number
*NEW* java.lang.Double (see exceptions)
*NEW* java.lang.Float (see exceptions)
*NEW* java.lang.Boolean (see exceptions)
*NEW* java.io.Serializable
*NEW* java.util.Random
java.lang.System (only currentTimeMillis, gc, and identityHashCode)
java.lang.Comparable
java.lang.Number
java.lang.Double (see exceptions)
java.lang.Float (see exceptions)
java.lang.Boolean (see exceptions)
java.io.Serializable
java.util.Random
*NEW* Teachpacks (PLT/collects/htdch)
*NEW* draw.*
Teachpacks (PLT/collects/htdch)
draw.*
exceptions:
String: String(byte[],int,int,String) -- incorrect
@ -106,39 +124,9 @@ _Libraries available to ProfessorJ:
Float: floatToIntBits, floatToRawBits, longBitsToFloat -- not implemented
Boolean: getBoolean(String) not implemented
_General New Items (New to 207 and 208)
New to all teaching language levels:
import package.name.*;
a teachpack directory (PLT/collects/htdch)
access to draw.* teachpack
New to Beginner:
super calls reallowed. For example
class A {
int x;
A(int x) {
this.x = x;
}
int adder() { return x + 1; }
}
class B extends A {
int y;
B( int x, int y) {
super(x);
this.y = y;
}
int adder() { return y + super.adder(); }
}
now works
== is restricted to comparing byte, short, int, long, char, and boolean
values
Classes may have initialized fields (i.e. int x = 3;)
_Unfinished constructs:
nested classes
static nested classes
switch
labeled statements (compiles but does not work correctly)
reflection
@ -146,9 +134,3 @@ _Unfinished constructs:
synchronized (compiles but is ignored)
strictfp (compiles but is ignored)

View File

@ -153,8 +153,8 @@
(TypeDeclaration
[(ClassDeclaration) $1]
[(InterfaceDeclaration) $1]
[(INTERACTIONS_BOX) $1]
[(CLASS_BOX) (parse-class-box $1 (build-src 1) 'advanced)]
#;[(INTERACTIONS_BOX) $1]
#;[(CLASS_BOX) (parse-class-box $1 (build-src 1) 'advanced)]
[(TEST_SUITE) $1]
[(EXAMPLE) $1]
[(SEMI_COLON) #f])

View File

@ -115,7 +115,7 @@
(TypeDeclaration
[(ClassDeclaration) $1]
[(InterfaceDeclaration) $1]
[(INTERACTIONS_BOX) $1]
#;[(INTERACTIONS_BOX) $1]
[(EXAMPLE) $1]
#;[(CLASS_BOX) (parse-class-box $1 (build-src 1) 'beginner)]
[(TEST_SUITE) $1]

View File

@ -154,8 +154,8 @@
(TypeDeclaration
[(ClassDeclaration) $1]
[(InterfaceDeclaration) $1]
[(INTERACTIONS_BOX) $1]
[(CLASS_BOX) (parse-class-box $1 (build-src 1) 'full)]
#;[(INTERACTIONS_BOX) $1]
#;[(CLASS_BOX) (parse-class-box $1 (build-src 1) 'full)]
[(TEST_SUITE) $1]
[(EXAMPLE) $1]
[(SEMI_COLON) #f])

View File

@ -140,8 +140,8 @@
(TypeDeclaration
[(ClassDeclaration) $1]
[(InterfaceDeclaration) $1]
[(INTERACTIONS_BOX) $1]
[(CLASS_BOX) (parse-class-box $1 (build-src 1) 'intermediate)]
#;[(INTERACTIONS_BOX) $1]
#;[(CLASS_BOX) (parse-class-box $1 (build-src 1) 'intermediate)]
[(EXAMPLE) $1]
[(TEST_SUITE) $1]
[(SEMI_COLON) #f])

View File

@ -1,4 +1,3 @@
#cs
(module lexer mzscheme
;; Lexical Analysis according to the Java Language Specification First Edition
@ -51,8 +50,7 @@
(STRING_LIT CHAR_LIT INTEGER_LIT LONG_LIT FLOAT_LIT DOUBLE_LIT
IDENTIFIER STRING_ERROR NUMBER_ERROR HEX_LIT OCT_LIT HEXL_LIT OCTL_LIT))
(define-tokens special-toks (CLASS_BOX INTERACTIONS_BOX EXAMPLE TEST_SUITE
IMAGE_SPECIAL OTHER_SPECIAL))
(define-tokens special-toks (EXAMPLE TEST_SUITE IMAGE_SPECIAL OTHER_SPECIAL))
(define (trim-string s f l)
(substring s f (- (string-length s) l)))
@ -319,15 +317,16 @@
#;("/**" (begin (read-document-comment input-port) (return-without-pos (get-token input-port))))
((special)
(syntax-case lexeme ()
((parse-example-box examples) (token-EXAMPLE (make-example-box (syntax examples))))
(_
(cond
((and (syntax? lexeme) (syntax-property lexeme 'test-case-box))
(token-TEST_SUITE (make-test-case lexeme)))
((is-a? lexeme (image-snip%))
(token-IMAGE_SPECIAL lexeme))
((token-OTHER_SPECIAL (list lexeme start-pos end-pos)))))))
(cond
((and (syntax? lexeme) (syntax-property lexeme 'test-case-box))
(token-TEST_SUITE (make-test-case lexeme)))
((and (syntax? lexeme) (syntax-property lexeme 'example-box))
(syntax-case lexeme ()
((parse-example-box examples) (token-EXAMPLE (make-example-box (syntax examples))))))
((is-a? lexeme (image-snip%))
(token-IMAGE_SPECIAL lexeme))
(else
(token-OTHER_SPECIAL (list lexeme start-pos end-pos)))))
#;(cond
((class-case? lexeme) (token-CLASS_BOX lexeme))

View File

@ -701,7 +701,6 @@
(drscheme:get/extend:extend-unit-frame java-comment-box-mixin)
;;Java interactions box
#;(define ji-gif (include-bitmap (lib "java-interactions-box.gif" "icons")))
(define ji-gif (include-bitmap (lib "j.gif" "icons")))
(define snipclass-java-interactions%
@ -762,7 +761,7 @@
(editor-filter #t))
ed type-recs level))
(reverse inputs-list))))
; (printf "~a~n~a~n" syntax-list (map remove-requires syntax-list))
;(printf "~a~n~a~n" syntax-list (map remove-requires syntax-list))
(if ret-list?
syntax-list
(datum->syntax-object #f `(begin ,@(map remove-requires syntax-list)) #f)))))