DOC PREVIEW
Columbia COMS W4115 - Patternizer

This preview shows page 1-2-3-4-5-6-7-8-55-56-57-58-59-60-61-62-111-112-113-114-115-116-117-118 out of 118 pages.

Save
View full document
Premium Document
Do you want full access? Go Premium and unlock all 118 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Patternizer Yianni Alexander Marinos Constantinides Boriana Ditcheva Yavor Tchakalov Adam Vartanian December 21 2005 Contents 1 Introduction 1 1 Overview 1 1 1 Description of the Language 1 1 2 Fundamentals Primitives 1 1 3 Fundamentals Operators 1 1 4 Miscellaneous 1 2 Advantages 1 2 1 Why Learn Patternizer 4 4 4 4 5 5 5 5 2 Tutorial 2 1 Sample Programs 2 1 1 Sample Program 1 Line 2 1 2 Sample Program 2 Rectangle 2 2 Getting an Image From Your Pattern File 2 3 Even Cooler Sample Program 6 6 6 6 7 7 3 Language Reference Manual 3 1 Lexical Conventions and Tokens 3 1 1 Comments 3 1 2 Identifiers 3 1 3 Numbers Constants 3 1 4 Strings 3 1 5 Keywords 3 1 6 Operators and Other Tokens 3 2 Types 3 2 1 Reals 3 2 2 Points 3 2 3 Strings 3 3 Expressions 3 3 1 Primary Expressions 3 3 2 Arithmetic 3 3 3 Relational 3 3 4 Logical 3 3 5 Operational 9 9 9 9 9 9 9 10 10 10 10 10 10 10 11 11 11 11 1 CONTENTS CONTENTS 3 3 6 Precedence of Operators Statements 3 4 1 Transformation Statements 3 4 2 Assignments 3 4 3 Loops 3 4 4 Conditional 3 4 5 Include Pattern Definition Internal Functions 3 6 1 Print Function 3 6 2 Color Settings 11 12 12 12 12 12 13 13 13 13 13 4 Project Plan 4 1 Project Timeline 4 1 1 Brainstorming 4 1 2 Proposal 4 1 3 Language Reference Manual 4 1 4 Development 4 1 5 Testing 4 1 6 Documentation 4 2 Team Responsibilities 4 2 1 Front End 4 2 2 Back End 4 2 3 Graphical Back End 4 2 4 Testing 4 2 5 Documentation 14 14 14 14 14 15 15 15 15 15 15 16 16 16 3 4 3 5 3 6 5 Architectural Design 17 5 1 Architecture 17 5 2 The Runtime Environment 18 5 3 Error Handling 18 6 Test Plan 6 1 Goals 6 2 Testing Stages 6 2 1 Stage 1 Basics 6 2 2 Stages 2 Patternizer Graphics 6 3 Test Programs That Fully Utilize the Potential of Patternizer 19 19 19 19 20 20 7 Lessons Learned 21 7 1 Weekly Meeting Times 21 7 2 Technical Tools 21 7 3 Prototyped Design 21 2 CONTENTS 8 Complete Listings 8 1 patternGrammar g 8 2 patternLexer java 8 3 patternParser java 8 4 pWalker java 8 5 Environment java 8 6 PatternizerException java 8 7 Pattern java 8 8 patternLexerTokenTypes java 8 9 test java CONTENTS 3 22 22 31 55 90 108 112 113 115 116 Chapter 1 Introduction 1 1 1 1 1 Overview Description of the Language The language will be used to create geometrical patterns which would otherwise be difficult and time consuming to create unless one has knowledge of graphic design tools The language works by combining points and lines into one object or entity called a pattern in our language This pattern can be a point a line a pentagon or simply a collection of lines The user can then manipulate this pattern further by scaling translating and rotating Patterns can also be defined to include other patterns within them thus arbitrarily complex geometric patterns can be created recursively 1 1 2 Fundamentals Primitives At the core of our language lies the concept of a pattern A pattern is essentially a template of how to draw something An actual copy of a pattern we will call an instance Patterns feature three intrinsic properties origin angle and scale The values of these properties are not absolute They are calculated in relation to the parent pattern the pattern which was used to create the current one Each pattern comes equipped with a default constructors that defaults its intrinsic properties to 0 0 0 1 0 respectively The language also provides default accessors and mutators for its intrinsic properties A pattern can also have custom properties defined by the user to avoid redundant coding of new patterns There exists the concept of a native pattern in Patternizer That is the Point pattern which represents a single point A Point will be viewed as a vector with regard to its intrinsic properties Thus scaling an instance of a Point e g modifying its scale from 1 0 to 2 0 will apply vector scaling with respect to the origin of the Point instance The remaining native data types or primitives will be floating point numbers 4 1 2 Advantages 1 1 3 Introduction Fundamentals Operators Real numbers will have all basic arithmetic operators defined on them addition subtraction multiplication and division Points are expressed as a pair x y and the operator will be used to create lines between points e g x1 y1 x2 y2 Scaling rotating and translating can be applied globally to the entire pattern file or within a pattern definition 1 1 4 Miscellaneous Standard control structures like for while if else would also be included with normal logical operators and would be the only valid operators on objects Printing would be allowed for debugging purposes and there are also options to include other defined pattern files and set background and foreground color 1 2 1 2 1 Advantages Why Learn Patternizer A user will be able to quickly learn this simple and concise language and be able to create arbitrarily complex patterns from simple geometric primitives like lines points and squares One of the strengths of the language is its recursive nature This feature not only adds power to what a user can do with the language but also encourages the user to think in a different way about patterns The user thinks about new patterns in terms of combining already existing ones thus simplifying the creative process 5 Chapter 2 Tutorial Pattern files are definitions of graphical patterns to be drawn They are simply a collection and organization of points and lines of which other patterns are constructed and all assembled together to form the parent pattern A point is represented as a pair of reals 25 50 A line is constructed by connecting points using the line operator For example then two points can be connected to form a line as such 25 50 50 50 These points lines and patterns can be manipulated using methods such as move scale and rotate Control flow of the program is dictated using loops conditionals declarations and operations Patterns are declared by the keyword pattern followed by an identifier for the pattern a list of parameters and a set of statements declaring how to draw the pattern 2 1 2 1 1 Sample Programs Sample Program 1 Line The simplest nontrivial pattern created by Patternizer is a straight line pattern line 0 0 40 0 2 1 2 Sample Program 2 Rectangle Patterns are declared by the keyword pattern followed by an identifier for the pattern a list of parameters somehow and a set of statements declaring how to draw the object Thus for example if Line produced …


View Full Document

Columbia COMS W4115 - Patternizer

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 Patternizer 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 Patternizer 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?