Unformatted text preview:

WCL Website Creation Language Sarah Friedman Toby S Lazar Miguel A Maldonado Matthew Mintz Habib Project Leader sf2179 tsl2103 mam2136 mm2571 columbia edu December 21 2004 1 Contents 1 Introduction 1 1 Ease of Use 1 2 Efficiency 1 3 Robustness 4 4 4 5 2 Language Tutorial 2 1 Hello world 2 2 Compiling and Creating Web Pages 2 3 A Second Example Tables Arrays and While Loops 5 5 6 6 3 Language Reference Manual 3 1 Lexical Conventions 3 1 1 White Space 3 1 2 Comments 3 1 3 Identifiers 3 1 4 Keywords 3 1 5 Punctuation 3 2 WCL File Structure 3 3 Operators 3 4 Primitive Data Types 3 4 1 Booleans 3 4 2 Integers 3 4 3 Floating Point Numbers 3 4 4 Strings 3 5 Arrays 3 6 Objects 3 6 1 WebPage 3 6 2 Paragraph 3 6 3 Link 3 6 4 Image 3 6 5 Table 3 7 Declarations 3 7 1 Variable Declarations 3 7 2 Function Declarations 3 8 Functions 3 9 Statements 3 9 1 Conditional Statements 3 9 2 While Loops 2 7 7 7 8 8 8 9 9 10 10 10 11 11 11 12 13 13 14 14 15 16 16 17 17 17 19 19 20 4 Project Plan 4 1 Organization of Project and Division of Labor 4 2 Software Development Environment 4 3 Project Log 21 21 21 21 5 Architectural Design 21 6 Test Plan 6 1 Example 1 Hello World 6 2 Example 2 Tables 6 3 Example 3 Failure 6 4 Perl Code for Regression Test Suite 22 24 24 26 26 7 Lessons Learned 7 1 Matthew 7 2 Miguel 7 3 Sarah 7 4 Toby 31 31 31 32 32 A WCL ANTLR Files A 1 WCL Grammar A 2 WCL Semantics A 3 WCL Code Generation 32 32 43 80 B WCL Java Code 95 3 1 Introduction Websites today comprise the single largest source of publicly accessible information worldwide Additionally they provide the easiest and most cost effective method of communicating information to a broad and geographically dispersed audience As such the ability to quickly and efficiently publish web pages is critically important for anyone wanting to display his or her information in the public view Currently the underlying language of most web pages is HTML Hyper Text Markup Language or some extension of that such as DHTML and XHTML In addition scripting abilities such as JavaScript and VB Script have been introduced that extend the functionality and usefulness of web pages Even entire languages such as Java and php can be embedded into web pages to improve their range of functionality Nevertheless creating web pages for large projects still remains a somewhat tedious if not outright difficult job for the inexperienced web designer To ease this job for the typical computer programmer we have created a new language the Website Creation Language WCL WCL is intended for the novice or experienced computer programmer whether or not he or she is experienced creating web pages with HTML The main goals are ease of use efficiency and robustness 1 1 Ease of Use The WCL syntax and semantics are intended to be intuitive to the typical computer programmer or anyone else familiar with basic programming constructs The notions of variables types keywords objects and functions are all integral parts of this language Basic methods for creating and manipulating tables links and images are intuitive and clearly identifiable Any individual with some experience coding in other languages should quickly become comfortable creating websites with WCL 1 2 Efficiency In order to help programmers create web pages quickly WCL facilitates the combination and reuse of web components This allows the programmer to create templates that can be used to create innovative web designs with a consistent look and feel Having primitive date types that relate directly to HTML constructs ensures that the resulting HTML code is valid in accordance with the W3C specification This eliminates the tiring and time consuming debugging process of web applications It also thereby ensures that the HTML output is compatible with all major browsers 4 1 3 Robustness Because of its simplicity WCL can be easily used to create websites from the most simple to the most complex The ability of WCL to include non HTML code such as JavaScript and DHTML allows for creating complex while keeping the basic structure of the WCL file simple and succinct 2 Language Tutorial 2 1 Hello world The best way to learn a new language is to starting writing some examples We start with the time honored tradition of creating the Hello world program We show the code for producing a simple web page that when loaded contains only Hello world WebPage hello Paragraph par par add Hello world hello add par hello save hello html In the first line a WebPage object is created and named hello In the second line a Paragraph object named par is created The third line adds the text Hello world to the par object That object is then inserted in to the hello WebPage object in line four Finally in line five the HTML web page is created from the hello object Quite apparent from this simple example is the ease with which a web page can be created We ll soon explain how to translate this code into a real HTML web page It is important to note here the structure of the WebPage object and the way that that the WebPage save method operates A WebPage object contains a list of references to the various objects that are inserted into it not their content It is therefore very easy to change the contents of a WebPage object by directly the object that it refers to The save method moves through the list of object references sequentially saving each object to HTML code Since a reference to the object and not a copy of the object is stored in the WebPage list when the save method is invoked the newest version of the object is saved If an object was changed from the time it was inserted before the time it was saved the newer changes will be reflected in the resulting web page In our example the third and fourth lines could have been interchanged with no effect on the resulting web page As you can see from this simple example the WCL is quite intuitive As you will see later the language for creating more complicated web pages is also quite intuitive 5 2 2 Compiling and Creating Web Pages In order to compile the WCL file and create the HTML web page s the following steps must be taken Before starting a WCL file must be created It must end with the extension wcl and may be empty The WCL compiler must then be run on the WCL file The compiler takes the WCL code and creates a single java source file that when compiled and executed creates the web page s This java source file should be compiled and executed like any java source file The following example


View Full Document

Columbia COMS W4115 - WCL - Website Creation Language

Documents in this Course
YOLT

YOLT

13 pages

Lattakia

Lattakia

15 pages

EasyQL

EasyQL

14 pages

Photogram

Photogram

163 pages

Espresso

Espresso

27 pages

NumLang

NumLang

6 pages

EMPATH

EMPATH

14 pages

La Mesa

La Mesa

9 pages

JTemplate

JTemplate

238 pages

MATVEC

MATVEC

4 pages

TONEDEF

TONEDEF

14 pages

SASSi

SASSi

16 pages

JTemplate

JTemplate

39 pages

BATS

BATS

10 pages

Synapse

Synapse

11 pages

c.def

c.def

116 pages

TweaXML

TweaXML

108 pages

Load more
Loading Unlocking...
Login

Join to view WCL - Website Creation Language and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view WCL - Website Creation Language and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?