WarmFusion Reference Manual

Similar documents
WarmFusion. A language for developing web applications. COMS W4115 Final Report. Robert Dong (rd2439) December 19, 2012

XQ: An XML Query Language Language Reference Manual

Sketchpad Graphics Language Reference Manual. Zhongyu Wang, zw2259 Yichen Liu, yl2904 Yan Peng, yp2321

Spoke. Language Reference Manual* CS4118 PROGRAMMING LANGUAGES AND TRANSLATORS. William Yang Wang, Chia-che Tsai, Zhou Yu, Xin Chen 2010/11/03

The Warhol Language Reference Manual

MATVEC: MATRIX-VECTOR COMPUTATION LANGUAGE REFERENCE MANUAL. John C. Murphy jcm2105 Programming Languages and Translators Professor Stephen Edwards

Language Reference Manual simplicity

Learning Language. Reference Manual. George Liao (gkl2104) Joseanibal Colon Ramos (jc2373) Stephen Robinson (sar2120) Huabiao Xu(hx2104)

GAWK Language Reference Manual

Cellular Automata Language (CAL) Language Reference Manual

Template Language and Syntax Reference

CHIL CSS HTML Integrated Language

Programming Languages & Translators. XML Document Manipulation Language (XDML) Language Reference Manual

DaMPL. Language Reference Manual. Henrique Grando

Ordinary Differential Equation Solver Language (ODESL) Reference Manual

\n is used in a string to indicate the newline character. An expression produces data. The simplest expression

CSc 10200! Introduction to Computing. Lecture 2-3 Edgardo Molina Fall 2013 City College of New York

ARG! Language Reference Manual

BoredGames Language Reference Manual A Language for Board Games. Brandon Kessler (bpk2107) and Kristen Wise (kew2132)

egrapher Language Reference Manual

Sprite an animation manipulation language Language Reference Manual

Turtle Tango (TT) Language Reference Manual

YOLOP Language Reference Manual

L-System Fractal Generator: Language Reference Manual

HAWK Language Reference Manual

JME Language Reference Manual

1 Lexical Considerations

Chapter 17. Fundamental Concepts Expressed in JavaScript

Contents. Jairo Pava COMS W4115 June 28, 2013 LEARN: Language Reference Manual

The PCAT Programming Language Reference Manual

Outline. Data and Operations. Data Types. Integral Types

d-file Language Reference Manual

Outcomes Week 2 Overview Describe the inputs, activities, and outputs of each step in the software development life cycle. Describe arithmetic, relati

COMS W4115 Programming Languages & Translators FALL2008. Reference Manual. VideO Processing Language (VOPL) Oct.19 th, 2008

COMP 110 Introduction to Programming. What did we discuss?

Chapter 1 Summary. Chapter 2 Summary. end of a string, in which case the string can span multiple lines.

RTL Reference 1. JVM. 2. Lexical Conventions

SFPL Reference Manual

EZ- ASCII: Language Reference Manual

The SPL Programming Language Reference Manual

Datatypes, Variables, and Operations

DINO. Language Reference Manual. Author: Manu Jain

ASML Language Reference Manual

Lexical Considerations

I Internal Examination Sept Class: - BCA I Subject: - Principles of Programming Lang. (BCA 104) MM: 40 Set: A Time: 1 ½ Hrs.

An-Najah National University Faculty of Engineering Electrical Engineering Department Programmable Logic Controller. Chapter 11 Math instruction

TML Language Reference Manual

Assoc. Prof. Dr. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved.

Lecture 3 Tao Wang 1

B E C Y. Reference Manual

TED Language Reference Manual

12/22/11. Java How to Program, 9/e. Help you get started with Eclipse and NetBeans integrated development environments.

Unit-II Programming and Problem Solving (BE1/4 CSE-2)

UNIT- 3 Introduction to C++

These are reserved words of the C language. For example int, float, if, else, for, while etc.

GOLD Language Reference Manual

LCSL Reference Manual

GridLang: Grid Based Game Development Language Language Reference Manual. Programming Language and Translators - Spring 2017 Prof.

Mirage. Language Reference Manual. Image drawn using Mirage 1.1. Columbia University COMS W4115 Programming Languages and Translators Fall 2006

Lexical Considerations

CA4003 Compiler Construction Assignment Language Definition

GraphQuil Language Reference Manual COMS W4115

Review: Exam 1. Your First C++ Program. Declaration Statements. Tells the compiler. Examples of declaration statements

EDIABAS BEST/2 LANGUAGE DESCRIPTION. VERSION 6b. Electronic Diagnostic Basic System EDIABAS - BEST/2 LANGUAGE DESCRIPTION

Typescript on LLVM Language Reference Manual

Dept. of CSE, IIT KGP

Scheme Quick Reference

VBScript: Math Functions

C/C++ Programming for Engineers: Working with Integer Variables

GBL Language Reference Manual

Pac Man Game Programming Language. Reference Manual. Chun Kang Chen (cc3260) Hui Hsiang Kuo (hk2604) Shuwei Cao (sc3331) Wenxin Zhu (wz2203)

Chapter 2 Using Data. Instructor s Manual Table of Contents. At a Glance. Overview. Objectives. Teaching Tips. Quick Quizzes. Class Discussion Topics

Senet. Language Reference Manual. 26 th October Lilia Nikolova Maxim Sigalov Dhruvkumar Motwani Srihari Sridhar Richard Muñoz

UNIT - I. Introduction to C Programming. BY A. Vijay Bharath

IPCoreL. Phillip Duane Douglas, Jr. 11/3/2010

Data and Variables. Data Types Expressions. String Concatenation Variables Declaration Assignment Shorthand operators. Operators Precedence

SMURF Language Reference Manual Serial MUsic Represented as Functions

ENGR 101 Engineering Design Workshop

In addition to the primary macro syntax, the system also supports several special macro types:

Le L c e t c ur u e e 2 To T p o i p c i s c t o o b e b e co c v o e v r e ed e Variables Operators

Sir Muhammad Naveed. Arslan Ahmed Shaad ( ) Muhammad Bilal ( )

SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics. Numbers & Number Systems

MELODY. Language Reference Manual. Music Programming Language

Scheme Quick Reference

Basics of Java Programming

Chapter 12 Variables and Operators

Angela Z: A Language that facilitate the Matrix wise operations Language Reference Manual

Full file at

Chapter 2. Lexical Elements & Operators

Objectives. In this chapter, you will:

C Language Part 1 Digital Computer Concept and Practice Copyright 2012 by Jaejin Lee

Basics of Programming

COMP Primitive and Class Types. Yi Hong May 14, 2015

Let's Look Back. We talked about how to create a form in HTML. Forms are one way to interact with users

Getting Started. Office Hours. CSE 231, Rich Enbody. After class By appointment send an . Michigan State University CSE 231, Fall 2013

Visual C# Instructor s Manual Table of Contents

PieNum Language Reference Manual

C++ Programming: From Problem Analysis to Program Design, Third Edition

OUTLINES. Variable names in MATLAB. Matrices, Vectors and Scalar. Entering a vector Colon operator ( : ) Mathematical operations on vectors.

Language Reference Manual

Transcription:

WarmFusion Reference Manual Robert Dong (rd2439) Table of Contents 1. Introduction... 2 2. Lexical Conventions... 2 2.1. Comments... 2 2.2. Identifiers... 2 2.3. Keywords... 2 2.4. Numerical Constants... 2 2.5. String Constants... 2 3. Types... 2 4. Expressions... 2 4.1. Unary Operators... 2 4.2. Multiplicative Operators... 3 4.3. Additive Operators... 3 4.4. Relational Operators... 3 4.5. Equality Operators... 3 4.6. expression % expression... 3 4.7. expression & expression... 4 5. Statements... 4 5.1. Assignment Statement... 4 5.2. Conditional Statement... 4 5.3. Loop Statements... 4 5.4. Argument Statement... 5 5.5. Return Statement... 5 5.6. Output Statement... 5 6. Function Declarations... 5 7. Scope Rules... 6 8. Example... 6 8.1. Example Code... 6 8.2. Output From Example... 7

1. Introduction WarmFusion is a web application development language based on the earlier language ColdFusion. WarmFusion has syntax similar to HTML/XML and allows users to place its tags inline with existing HTML/XML code. The output generated by a WarmFusion application is often viewed in a web browser. 2. Lexical Conventions 2.1. Comments The characters <!--- introduce a comment, which terminates with the characters --->. 2.2. Identifiers An identifier is a sequence of letters and digits. The first character must be a letter. The underscore counts as a letter. Identifiers are case-sensitive. 2.3. Keywords All identifiers beginning with the letters wf are reserved keywords. The following identifiers are also reserved keywords: NOT, LT, LTE, GT, GTE, EQ, NEQ. 2.4. Numerical Constants A numerical constant consists of an integer part and/or a decimal part. The integer part consists of one or more digits. The decimal part consists of a. followed by one or more digits. 2.5. String Constants A string constant is a sequence of characters surrounded by double quotes. 3. Types WarmFusion supports two fundamental types: number and string. A numerical constant as described above is considered a number while a string constant is considered a string. 4. Expressions 4.1. Unary Operators 4.1.1. expression The result is the negative of the expression. The type of the expression must be

4.1.2. NOT expression The result of the logical negation operator NOT is 1 if the value of the expression is 0, or 0 if the value of the expression is non-zero. The type of the result is numeric. The type of the expression must be 4.2. Multiplicative Operators 4.2.1. expression * expression The binary * operator indicates multiplication. The type of both expressions must be 4.2.2. expression / expression The binary / operator indicates division. The type of both expressions must be 4.3. Additive Operators 4.3.1. expression + expression The result is the sum of the expressions. The type of both expressions must be 4.3.2. expression expression The result is the difference of the expressions. The type of both expressions must be 4.4. Relational Operators 4.4.1. expression LT expression 4.4.2. expression GT expression 4.4.3. expression LTE expression 4.4.4. expression GTE expression The operators LT (less than), GT (greater than), LTE (less than or equal to) and GTE (greater than or equal to) all yield 0 if the specified relation is false and 1 if it is true. The type of both expressions must be 4.5. Equality Operators 4.5.1. expression EQ expression 4.5.2. expression NEQ expression The EQ (equal to) and the NEQ (not equal to) operators yield 0 if the specified relation is false and 1 if it is true. 4.6. expression % expression The binary % operator yields the remainder from the division of the first expression by the second. The type of both expressions must be

4.7. expression & expression The result is a string of the two concatenated expressions. The type of both expressions must be string. 5. Statements Except as described, s are executed in sequence. If a string is in the code that is not categorized as a or function declaration, that string is outputted to the user (i.e. HTML code is outputted to the user). 5.1. Assignment Statement Assigning a value to a variable takes place as follows: <wfset lvalue = expression /> 5.2. Conditional Statement The two forms of the conditional are: <wfif expression> </wfif> and <wfif expression> <wfelse> </wfif> In both cases, the expression is evaluated and if it is non-zero, the first sub will be executed. In the second case, the second sub is executed if the expression is 0. The wfelse is associated with the most recent wfif. 5.3. Loop Statements 5.3.1. Conditional Loop A conditional loop has the form: <wfloop condition= expression > </wfloop> The sub is executed repeatedly as long as the value of the expression remains non-zero. The test takes place before each execution of the.

5.3.2. Loop with counter A loop with a counter has the form: <wfloop index= variable from= number1 to= number2 > </wfloop> The variable is initialized to number1. The sub will be executed repeatedly as long as the value of variable is less than or equal to number2. The test takes place before each execution of the. After the sub execution, variable is incremented by one. 5.4. Argument Statement A function specifies the names of its arguments in the following form: <wfargument name= argname /> A wfargument tag may only follow the opening wffunction tag or another wfargument tag. 5.5. Return Statement A function returns to its caller by means of the wfreturn, which has the form: <wfreturn expression /> 5.6. Output Statement Output s allow values of expressions to be evaluated and displayed to the user. Output s have the following form: #expression# Output s are often used to display the value of a variable to the user. 6. Function Declarations A function declaration has the form: <wffunction name= NameOfFunction > <wfargument name= arg1 /> <wfargument name= arg2 /> <wfargument name= argn /> <wfreturn 0 /> A simple example of a complete function definition is:

<wffunction name="calculateareaofsquare"> <wfargument name="sidelength" /> <wfset area = sidelength * sidelength /> <wfreturn area /> 7. Scope Rules All variables share the same scope. Even if a variable is first set within a function, that variable will be visible after the function has finished executing. Similarly, if a variable is first set within a loop, the variable can still be used after the loop has completed. 8. Example An example of WarmFusion code is shown below. WarmFusion code is mixed in with the HTML code which allows rapid development of simple web applications. The code declares two functions CalculateAreaOfSquare and CalculateDiagonalOfSquare, both of which take one argument. An example of a comment in WarmFusion is shown in the second function. An HTML table is printed out and WarmFusion loops through the numbers 1 through 10 to display each row. In the table, there is a conditional which highlights a row gray if it is odd. The two functions are called in the loop to create the table of data. As shown, all WarmFusion s are HTML/XML tags that begin with wf. 8.1. Example Code <wffunction name="calculateareaofsquare"> <wfargument name="sidelength" /> <wfset area = sidelength * sidelength /> <wfreturn area /> <wffunction name="calculatediagonalofsquare"> <wfargument name="sidelength" /> <!--- Length of a side multiplied by the square root of 2 ---> <wfset diagonal = sidelength * Sqr(2) /> <wfreturn diagonal /> <h1>square Information:</h1> <table border="1"> <tr> <th>side Length</th> <th>area of Square</th> <th>diagonal of Square</th> </tr> <wfloop index="i" from="1" to="10">

<wfif i % 2 EQ 1> <wfset rowbgcolor = "lightgray" /> <wfelse> <wfset rowbgcolor = "white" /> </wfif> <tr bgcolor="#rowbgcolor#"> <td>#i#</td> <td>#calculateareaofsquare(i)#</td> <td>#calculatediagonalofsquare(i)#</td> </tr> </wfloop> </table> 8.2. Output From Example HTML code would be generated from the previous example. It would be shown in a web browser as follows: