CHIL CSS HTML Integrated Language

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

VENTURE. Section 1. Lexical Elements. 1.1 Identifiers. 1.2 Keywords. 1.3 Literals

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

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

Java+- Language Reference Manual

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

CSC Web Programming. Introduction to JavaScript

DINO. Language Reference Manual. Author: Manu Jain

1 Lexical Considerations

egrapher Language Reference Manual

BASIC ELEMENTS OF A COMPUTER PROGRAM

Lexical Considerations

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

UNIT- 3 Introduction to C++

Decaf Language Reference Manual

CHAD Language Reference Manual

FRAC: Language Reference Manual

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

C++ Basic Elements of COMPUTER PROGRAMMING. Special symbols include: Word symbols. Objectives. Programming. Symbols. Symbols.

Lexical Considerations

CA4003 Compiler Construction Assignment Language Definition

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

Sprite an animation manipulation language Language Reference Manual

Language Reference Manual simplicity

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

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

Full file at

Ordinary Differential Equation Solver Language (ODESL) Reference Manual

Basics of Java Programming

JME Language Reference Manual

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

Typescript on LLVM Language Reference Manual

YOLOP Language Reference Manual

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

Crayon (.cry) Language Reference Manual. Naman Agrawal (na2603) Vaidehi Dalmia (vd2302) Ganesh Ravichandran (gr2483) David Smart (ds3361)

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

MATLIP: MATLAB-Like Language for Image Processing

L-System Fractal Generator: Language Reference Manual

String Computation Program

Character Set. The character set of C represents alphabet, digit or any symbol used to represent information. Digits 0, 1, 2, 3, 9

Expressions and Data Types CSC 121 Spring 2015 Howard Rosenthal

DEPARTMENT OF MATHS, MJ COLLEGE

Chapter 2. Lexical Elements & Operators

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

EZ- ASCII: Language Reference Manual

Lecture 2 Tao Wang 1

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

Chapter 2: Introduction to C++

Chapter 2: Special Characters. Parts of a C++ Program. Introduction to C++ Displays output on the computer screen

GBIL: Generic Binary Instrumentation Language. Language Reference Manual. By: Andrew Calvano. COMS W4115 Fall 2015 CVN

Objectives. Chapter 2: Basic Elements of C++ Introduction. Objectives (cont d.) A C++ Program (cont d.) A C++ Program

Chapter 2: Basic Elements of C++

Chapter 2: Basic Elements of C++ Objectives. Objectives (cont d.) A C++ Program. Introduction

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

CGS 3066: Spring 2015 JavaScript Reference

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

Chapter 2: Using Data

By the end of this section you should: Understand what the variables are and why they are used. Use C++ built in data types to create program

4. Inputting data or messages to a function is called passing data to the function.

Operators & Expressions

XQ: An XML Query Language Language Reference Manual

DaMPL. Language Reference Manual. Henrique Grando

COMS W4115 Programming Languages & Translators GIRAPHE. Language Reference Manual

SSOL Language Reference Manual

SECTION II: LANGUAGE BASICS

The Arithmetic Operators. Unary Operators. Relational Operators. Examples of use of ++ and

The Arithmetic Operators

Program Fundamentals

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

Introduction. Following are the types of operators: Unary requires a single operand Binary requires two operands Ternary requires three operands

LESSON 1. A C program is constructed as a sequence of characters. Among the characters that can be used in a program are:

Key Differences Between Python and Java

ASML Language Reference Manual

Features of C. Portable Procedural / Modular Structured Language Statically typed Middle level language

Onion Language Reference Manual. By: Andrew Aday, (aza2112) Amol Kapoor (ajk2227), Jonathan Zhang (jz2814)

CS /534 Compiler Construction University of Massachusetts Lowell. NOTHING: A Language for Practice Implementation

LECTURE 02 INTRODUCTION TO C++

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

The Warhol Language Reference Manual

CS4120/4121/5120/5121 Spring 2016 Xi Language Specification Cornell University Version of May 11, 2016

PHPoC vs PHP > Overview. Overview

ARG! Language Reference Manual

Petros: A Multi-purpose Text File Manipulation Language

The SPL Programming Language Reference Manual

SFPL Reference Manual

CSCE 110 PROGRAMMING FUNDAMENTALS

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

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

CSI33 Data Structures

Creating a C++ Program

Unit 3. Operators. School of Science and Technology INTRODUCTION

CS 4240: Compilers and Interpreters Project Phase 1: Scanner and Parser Due Date: October 4 th 2015 (11:59 pm) (via T-square)

PHPoC. PHPoC vs PHP. Version 1.1. Sollae Systems Co., Ttd. PHPoC Forum: Homepage:

corgi Language Reference Manual COMS W4115

COLOGO A Graph Language Reference Manual

The PCAT Programming Language Reference Manual

CMAT Language - Language Reference Manual COMS 4115

Introduction to Programming Using Java (98-388)

Visual C# Instructor s Manual Table of Contents

Object oriented programming. Instructor: Masoud Asghari Web page: Ch: 3

Transcription:

CHIL CSS HTML Integrated Language Programming Languages and Translators Fall 2013 Authors: Gil Chen Zion gc2466 Ami Kumar ak3284 Annania Melaku amm2324 Isaac White iaw2105 Professor: Prof. Stephen A. Edwards 1

CONTENTS 1. INTRODUCTION 2. LEXICAL CONVENTIONS 2.1 Comments 2.2 Primitive Types 2.3 Identifiers 2.4 Keywords 3. EXPRESSIONS 3.1 Operators 3.2 Increment Operators 3.3 Multiplicative Operators 3.4 Additive Operators 3.5 Inequality Operators 3.6 Comparison Operators 3.7 Logical Operators 3.8 Precedence 4. FUNCTIONS 4.1 Function Call 4.2 Recursion 4.3 Built in Functions 5. DECLARATIONS 5.1 Variable Declaration 5.2 Function Declaration 5.3 Scoping 6. STATEMENTS 6.1 Conditional Statement 6.2 For Loop 6.3 Return Statements 7. TYPE CONVERSIONS 8. OUTPUT 2

1. INTRODUCTION CHIL is an HTML and CSS combined website generator targeted specifically for the novel web developer. Instead of learning both the complexities of HTML and the complexities of CSS, CHIL allows the developer to create functional, stylistic, and dynamic web pages through the mastery of only one language. This language will combine both content and styling in one language so that the user isn t constantly switching between files. Furthermore, it provides the ability to programmatically loop through different types of element creation, or define more complex elements made up of basic types provided by the language. 2. LEXICAL CONVENTIONS 2.1 Comments Multi line comments begin with @> and end with <@. A single line comment is preceded by @. The nesting of comments is allowed. 2.2 Primitive Types Key Word int string float boolean element style array Description non decimal number sequence of characters decimal number true or false value fundamental container that can contain text or images characteristics of an element list of primitives of a single type 2.2.1 Integers A data type consisting of whole number values. Examples: x = 5 y = 0 z = 20 3

2.2.2 Strings A constant representing character strings. Examples: x = Hello World y = abc String Concatenation Strings are combined using + operator. Examples: x = Hello y = World z = x+y ( Hello World ) or z = Hello + World 2.2.3 Floats A numeric data type containing a decimal. Examples of floats are: 125.3 3.0 3. 2.2.4 Booleans Booleans are incorporated in the use of boolean operators. The use of a boolean operator in comparison expressions return one of two predefined constants: true or false. Boolean operators used in comparisons: ==,!=, =<, =>, <, > Examples: x = 3 y = 3 z = 1 x == y x > y x > z (evaluates to true) (evaluates to false) (evaluates to true) 4

z!= y y => x (evaluates to true) (evaluates to true) 2.2.5 Elements Elements are the fundamental container for any object which is intended to eventually be rendered as HTML. An element's attributes determine which tag will eventually be associated with it. Example: someelementname = { contents: I m an element., style: ${ namedeclaredbyprogram: somevalue }, children: @> children not provided here, since it often makes sense to define them as another variable or add them on to defined elements later via the someelementname.children[] = operator. <@ } 2.2.6 Styles All elements have a property called style, which is provided without any allowed values. Page.addStyle() can be used to add possible values to the list for allowed properties, which will tell the compiler that the keywords are permitted. Styles are processed by by the Page.toHtml() method, which the programmer is responsible for providing. If no Page.toHtml() method is set, then the compiler will use a provided fallback that is not accessible to the programmer. If Page.toHtml() produces invalid output, the compiler will also fallback to the built in, inaccessible method. Style is defined at the time of Element declaration, but styles may be added by referencing Element.style.someStyleName. Style elements are declared with ${} syntax, using the equals operator. Examples: @>In this example, keywords have been previously provided by a standard library<@ 3pxBorderTop = ${ border: top,3px,solid, innerspacing: top,.25, outerspacing: top,.25 5

} 2.2.7 Arrays An array is a list of objects or primitive types. All elements of an array must be of the same type. Arrays can be concatenated by using the + operator. Any array that is used in an addition operation will take precedence for returning the output as an array. However, since arrays may contain only a single type, this operation may fail if not used with matching types. Values can also be added to the end of the array using varname[] = someval Examples: r = [] (initialize an empty array) x = [ hello, world ] (array of Strings) y = [42,34,42] (array of type int) r[] = 34 @add 34 to the end of the r array s = [42] @make a new array called s z = r + s @> z = [34,42] <@ 2.3 Identifiers Identifiers consist of uppercase and lowercase letters, numbers, and underscore (_). The first letter cannot be a digit or an underscore (_). Two different identifiers cannot have the same name. 2.4 Keywords element style page if endif else elseif for endfor rtn fn endfn page 3. EXPRESSIONS 6

3.1 Operators Function Name Description = assignment operator ++, increment and decrement +,, *, / basic arithmetic operators ==,!= comparison operators, by value <, <=, >, >= inequality operators, by value % modulus denotes a string (,) contains an expression &&, logical operators 3.2 Increment Operators Increment and decrement are unary operators that work on a single integer. The increment operators follow an integer value expression, as follows: expr++ ++ increment decrement 3.3 Multiplicative Operators The multiplicative operators are *and /. Both can be used on integer or float value expressions. Multiplication and division operators are formatted as follows: expr * expr expr / expr * multiplicaton 7

/ divison 3.4 Additive Operators The additive operators are +and, and are also used on integer or float value expressions. The format of addition and subtraction is similar to that of multiplication and division. expr + expr expr expr + addition subtraction 3.5 Inequality Operators Inequality operators compare two integer or two float expressions. The inequality operators are <, >, <=, and >=. An expression with an equality has the following format: expr < expr < less than > greater than <= less than or equal to >= greater than or equal to 3.6 Comparison Operators Two integer or float operands can be compared by the operators ==and!=. For example: expr == expr == equal to!= not equal to 3.7 Logical Operators 8

The two logical operators are &&and. Two boolean value expressions can be combined by either AND or OR as follows: (3 < 4) && (4 < 5) evaluates to true (3 > 5) (6!= 7) evaluates to false && and or 3.8 Precedence The following list shows the precedence of all the operators, from highest to lowest precedence: Parenthesis Increment operators Multiplicative operators Additive operators Inequality operators Comparison operators Logical operators 4. FUNCTIONS 4.1 Function Call Functions will be called by their identifier, with arguments specified in parenthesis and separated by commas. Member functions will be called after an object and separated by a period. For example, for the function func : func(1, 2) a.func(1, 2) 4.2 Recursion Recursive functions cannot be defined. No function can call itself recursively. 4.3 Built in Functions tohtml() converts the program into HTML. If no tohtml() is defined, a default tohtml() is used. Otherwise, the new tohtml() is used for the conversion. 9

*for functions to convert types see Section 7. Type Conversions 5. DECLARATIONS 5.1 Variable Declaration Variables are declared by their identifier and assigned values using =. Integers just include digits and floats contain a single decimal point. Strings are identified by opening and closing quotes and arrays are denoted by opening and closing square brackets. The following are examples of variable declarations: a = Hello World b = 42 c = [ hello, world ] d = [42,34,42] e = [a] 5.2 Function Declaration Functions are declared by the keyword fnand an identifier, which is used to refer to the function throughout the program. Parameters are passed to the function in parenthesis and separated by commas. The body of a function is closed by the endfnkeyword. The format of a function declaration is as follows: fn identifier(parameter list) @ body of function endfn 5.3 Scoping Variables declared within the program scope can be accessed by all functions in the file. Variables declared within a statement (ifor for) or function have a scope that lasts within the body of the statement or function, starting at the variable declaration and ending at endif, endfor, or endfn. 6. STATEMENTS 6.1 Conditional Statement An if statement begins with the ifkeyword and ends with endif. If is followed by a condition contained in parenthesis. The body of the if statement is followed by endif, as follows: if (condition) @ body of if endif 10

6.2 For Loop A for loop starts with forand ends in endfor. For is followed by three expressions enclosed in parenthesis and separated by semicolons. The first expression is evaluated before the body of the for loop. The body of the loop is executed whenever the second expression evaluates to true. The last expression is evaluated after each iteration of the loop. The format of the for loop is as follows: for (expr; expr; expr) @ body of loop endfor 6.3 Return Statements All functions return a data type using the rtnkeyword. If the keyword is not included the function will return undefined. fn identifier(parameter list) @ body of function @ optional return statement rtn type endfn 7. TYPE CONVERSIONS The following functions take one argument of the type they are converting from and return a value of the type they are converting to: stf itf fti sti its fts string to float int to float float to int string to int int to string float to string 8. OUTPUT 11

Once compiled, each program will output both an HTML and a CSS file. Example: http://www.columbia.edu/~iaw2105/plt/ 12