Nice

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Scripting » Nice 
Nice Scripting Languages
License:GNU General Public License (GPL)
URL:http://nice.sourceforge.net
Description:Nice is a new programming language.
Package NameComment
bossa.modules The package system. Loads packages from directories, jar files, ...

Copyright

This package is free software. It is released under the GNU General Public License.

Copyright Daniel Bonniot.

bossa.parser
bossa.syntax The abstract syntax tree.

Copyright

This package is free software. It is released under the GNU General Public License.

Copyright Daniel Bonniot.

bossa.util General interest tools (debugging, ...).

Copyright

This package is free software. It is released under the GNU General Public License.

Copyright Daniel Bonniot.

gnu.bytecode The gnu.bytecode package

Contains classes to generate, read, write, and print Java bytecode (.class) files.

It is used by Kawa to compile Scheme into bytecodes; it should be useful for other languages that need to be compiled into Java bytecodes. (An interesting exercise would be an interactive Java expression evaluator.) The classes here are relatively low-level. If you want to use them to generate bytecode from a high-level language, it is better to use the gnu.expr package, which works at the expression level, and handles all the code-generation for you.

Javadoc generated documentation of the class is available online.

The most important class is ClassType. This contains information about a single class. Note that the difference between ClassType and java.lang.Class is that the latter only represents existing classes that have been loaded into the Java VM; in contrast, ClassType can be used to build new classes incrementally and on the fly.

A ClassType has a list of Field objects; new ones can be added using the various addField methods. A ClassType manages a ConstantPool. A ClassType also has a list of Method objects; new ones can be created by the various addMethod objects.

A Method contains many methods you can use to generate bytecode. See Kawa for examples.

Once you have finished generating a ClassType, you can write it to a .class file with the writeToFile method. You can also make a byte array suitable for ClassLoader.defineClass using the writeToArray method. This is used by Kawa to compile and immediately load a class.

You can also print out the contains of a ClassType in human-readable form using the class ClassTypeWriter. This prints a fair bit of information of the generated class, including dis-assembling the code of the methods.

You can also build a ClassType by reading it from an existing .class file by using a ClassFileInput class. This reads the constant pool, the fields, methods, superclass, and interfaces. The gnu.bytecode.dump class has a main method that prints out the information in a named class file.

Zip archive manager

To build, extract, list, or print a zip file, you can use ZipArchive as an application:
java gnu.bytecode.ZipArchive [txpq] archive [file ...]
See the comments for ZipArchive.main. ZipArchive does not do compression or uncompressions, and it is reported that that some programs do not like the archives it creates. It is probably best suited for listing and extracting from classes.zip-like archives. (This class has been partially re-written to use java.util.zip. It may get dropped in the future.)

Class file dumper

To print out the contents of a class file foo.class, you can use the class dump as an application:
java gnu.bytecode.dump foo.class
This will print out the constant pool, fields, methods, superclass, and implemented interfaces of class foo. It is useful for printing out detailed information about the constant pool, which javap does not do.

License

See the file COPYING.

Author

Per Bothner <per@bothner.com>

How to get it

The gnu.bytecode package is currently distributed as part of Kawa, though it can be used independent of the rest of Kawa.

Bugs and patches

Send them to per@bothner.com, or to the Kawa mailing list.
gnu.expr The gnu.expr Package Supports Expression, and various related classes need to compile programming languages.

The exact set of classes in this package is still somewhat in flux.

License

See the file COPYING.

Author

Per Bothner <per@bothner.com>

Bugs and patches

Send them to per@bothner.com, or to the Kawa mailing list.
gnu.lists The gnu.lists package

Contains utility classes and interfaces for sequences (lists), arrays, and trees.

Features:

  • The classes and interfaces are compatible with the Java2 Collections framework, but do not rquire them. A configuration option allows you to specify whether Sequence extends java.util.List or not.
  • Positions in a Sequence and iterators are the same kind of object, and are represented using magic cookies. In most collections frameworks, when you define a new class that implements a sequence, you would typically define a new iterator class as well. You never do that with gnu.lists; instead you implement suitable methods in the sequence class itself. This approach may seem strange, but it has important performance advantages, especially in applications where you want to go up and down nested sequences (i.e. in trees, such as XML elements), or remember sets of positions (such as XML node-sets).
  • The classes are designed for efficiency, especially concentrating on minimizing object allocation.
  • The framework supports general muli-dimensional arrays.
  • The package is self-contained; it does not depend on classes or features not in JDK 1.1.
  • Various useful sequence implementations, including Lisp-style linked lists; arrays with various element types; adjustable arrays that use a "buffer-gap" to make insertions and deletions more efficient; and adjustable arrays that automatically update positions on insertions and deletions.
  • The TreeList class can compactly represent a nested hetrogenous tree. One intended usage is as a very efficient representation for XML data.
  • The Consumer interface is an abstraction of "data sinks" - objects that can receive data and do something with them. It is similar to SAX's DocumentHandler but at a more abstract (and sometimes more efficient) level.

The iteration and position framework

A position points between two elements in its "containing" sequence, or it points before the first element (if any), or after the last. Sometimes, we loosely say that the position refers to or points to an element of the sequence; in that case we mean the position is immediately before the element.

An iterator is an object that has a current position, but that can be moved so it gets a new position. What needs to be emphasized is that all Sequence implementations. use the same SeqPosition class to implement positions and iteration. In other "collections frameworks" each sequence class has its corresponding iterator class, but in this framework you instead add the methods that handle iteration to the sequence class itself, extending the AbstractSequence class. A consequence of this is that if you have an unused SeqPosition object, you can use it to iterate over any Sequence you choose. This potentially saves memory allocation, which gains you the most when iterating over a nested sequence structure, like a tree of XML data.

We do this by requiring that any position be representable using a pair of an int and an Object. In other words, the state of an iterator is restricted to be an (int, Object) pair. Of course that is all you could need, since if you need more state you can always create a helper object, and store the extra state there. The assumption we make though is that for most Sequences, an (int, Object) would be enough, without creating any new objects (beyond, sometimes, the SeqPosition itself).

The int part of a position-state is normally named ipos, and the Object part of a position-state is named xpos. Neither of these values have any meaning in themselves, they only have meaning as interpreted by the specific Sequence. For example, ipos might be the offset of the position in the sequence, but it might also some "magic cookie". If a Sequence supports insertions and deletions, and you want positions to be automatically adjusted, then a position has to be a magic cookie rather than an offset. (A typical implementation is for such a position to be an index into a table of positions managed by the Sequence itself.) So a complete position is actually a (int, Object, AbstractSequence) triple, where the AbstractSequence component is the object that interprets the (int, Object) pair. Normally, the AbstractSequence part of a position triple is the Sequence "containing" the position, but it can be any AbstractSequence that implements the various methods that provide the semantics for the (int, Object) pair.

The PositionContainer interface is a more abstract version of SeqPosition, in that it can represents more than one position. For example, instead of an array of separately allocated SeqPosition objects, you might use some data structure that implements PositionContainer, which is abstractly a list of (int, Object, Sequence)-triples.

The consumer protocol

You typically use an iteration framework it process the elements of a sequence in such a way that the data consumer is active and in control, while the sequence itself (the data producer) is a passive object. The Consumer works the other way round: The data producer is active and in control, while the data consumer is passive, consuming elements when requested by the data producer. The Consumer is a more abstract variant of SAX's ContentHandler interface for processing "events"; however Consumer is intended for general value sequences, and is less tied to XML.


Per Bothner
Last modified: Sun Jun 17 10:32:21 CST 2001
gnu.mapping The gnu.mapping Package

Supports Procedure, and various related classes needed at run-time by dynamically types languages (such as Scheme and ECMAScript).

The exact set of classes in this package is still somewhat in flux.

License

See the file COPYING.

Author

Per Bothner <per@bothner.com>

Bugs and patches

Send them to per@bothner.com, or to the Kawa mailing list.
gnu.text The gnu.text Package

Supports various utility classes for formatting, parsing, and manipulating text (strings).

It is used by Kawa.

License

See the file COPYING.

Author

Per Bothner <per@bothner.com>

How to get it

The gnu.text package is currently distributed as part of Kawa, though it can be used independent of the rest of Kawa.

Bugs and patches

Send them to per@bothner.com, or to the Kawa mailing list.
mlsub.compilation Provides tools for compiling ML-sub based languages.

Copyright

This package is free software. It is released under the GNU General Public License.

Copyright Daniel Bonniot.

mlsub.typing Implementation of a type checker for the ML-Sub type system.

Copyright

This package is free software. It is released under the GNU General Public License.

Copyright Daniel Bonniot.

mlsub.typing.lowlevel
nice.lang
nice.lang.inline
nice.tools.ant
nice.tools.code
nice.tools.compiler
nice.tools.testsuite
nice.tools.testsuite.output
nice.tools.typing
nice.tools.util
regtest.basic
regtest.java.B
regtest.java.J
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.