SASSi A Language For Statistics Programming Languages Translators Fall 2003 Carl Morgan Group Leader Paul Salama Xiaotang Zhang 1 Table of Contents INTRODUCTION 5 1 1 Purpose 5 1 2 Overview 5 1 3 Functionality 6 2 TUTORIAL 8 2 1 Getting Started 8 2 2 Alternative Command line SASSi 8 2 3 Variable Declarations 8 2 4 Vector Procedure 9 2 5 Print Functions 9 2 6 Vector Arithmetic 9 2 7 Statistics Procedure 9 2 8 if else Statements 9 2 9 Plotting Procedure 10 2 10 Finishing Up 11 3 LANGUAGE REFERENCE MANUAL 12 3 1 Lexical Conventions 12 3 1 1 Comments 12 3 1 2 Identifiers 12 3 1 3 Keywords 12 3 1 4 Numbers 12 3 1 5 String Literals 12 3 1 6 Other Tokens 13 3 2 Types 13 3 3 Expression 13 3 3 1 Primary Expression 13 3 3 2 Identifier 13 3 3 3 Constant 14 3 3 4 Procedure Calls 14 3 3 5 Access to Vector Types 14 3 3 6 expression 14 3 3 7 Arithmetic Expressions 14 3 3 8 Relational Expressions 15 3 4 Vector Indexes 15 3 5 Variable and Constant Declaration 15 3 6 Statements 16 3 6 1 Statements in and s 16 3 6 2 Assignments 16 3 6 3 Conditional Statements 17 3 6 4 Procedure Calls 17 3 6 5 Return Statements 18 3 6 6 Including Other Files 18 3 7 Procedure Definitions 18 1 2 3 8 Internal Functions 19 3 8 1 Print 19 3 8 2 What 19 3 8 3 Plot 20 3 8 4 Built in Statistics Constants 21 3 8 5 Built in Statistics Procedures 21 4 PROJECT PLAN 26 4 1 Team Responsibilities 26 4 2 Programming Style Coding Conventions 26 4 2 1 ANTLR Coding Style 26 4 2 2 Java Coding Style 27 4 2 3 SASSi Coding Style 28 4 3 Project Timeline 28 4 4 Software Development Environment 29 4 4 1 Operating Systems 29 4 4 2 Java 1 3 1 29 4 4 3 ANTLR 2 7 2 29 4 4 4 Programming Tools 29 4 5 Project Log 30 5 ARCHITECTUAL DESIGN 31 6 TEST PLAN 32 6 1 Goal 32 6 2 The First Stage Command Line Testing 32 6 3 The Second Stage Advanced Testing Examples 32 6 4 permute ssi 32 6 5 school ssi 33 7 LESSONS LEARNED 36 7 1 Carl s Lessons 36 7 2 Paul s Lessons 36 7 3 Xiaotang s Lessons 36 8 APPENDIX 37 8 1 SASSiBool java 37 8 2 SASSiBuiltInProcedure java 38 8 3 SASSiDataType java 45 8 4 SASSiDouble java 48 8 5 SASSiException java 50 8 6 SASSiInt java 50 8 7 SASSiInterpreter java 52 8 8 SASSiLexer java 59 8 9 SASSiMain java 83 8 10 SASSiParser java 86 8 11 SASSiPlotter java 125 8 12 SASSiProcedureCall java 131 8 13 SASSiStatisticalMethords java 132 8 14 SASSiString java 141 8 15 SASSiSymbolTable java 142 3 8 16 8 17 8 18 8 19 8 20 8 21 8 22 8 23 8 24 8 25 SASSiTokenTypes java 144 SASSiVariable java 146 SASSiVector java 146 SASSiWalker java 149 SASSiWalkerTokenType java 167 SsVector java 168 blah g 173 blahwalk3 g 179 permute ssi 183 school ssi 183 4 1 INTRODUCTION 1 1 Purpose SASSi s purpose is to create an efficient and easy to use scheme for handling statistics The language is designed to let the user make quick and simple programs to deal with various statistical problems The hope is that SASSi will be seen as an alternative to the disaster that is SAS Despite its longer name SASSi would be smaller than the unnecessarily bloated SAS It would also be free allowing those who can t stomach SAS s 120 price tag namely everybody Compute variance and standard deviations graphically Learn more from a generated pie chart with a small glance at a computer screen Think about never having to figure out what libraries are needed and how to use them SASSi makes it all possible 1 2 Overview SASSi A simple powerful efficient easily made graphical customizable and architecture neutral language Borrowing the form set forth by the Java white paper we are using similar buzzwords to describe the features of our language This only seems natural since our language will compile into Java code SASSi has features that are helpful to any organization or student using statistics and can easily be learned and applied The following explanation of the previous buzzwords will further help you to understand the characteristics of SASSi Simple When designing a system for statistics there are two focuses the set up of the model and the representation of that model Because SASSi inherently has its own data types and constructs it is simple to set up a statistics system Also it is easy for any user to make additions to the model or change behavior of an entire program The language is simple and easy to learn because of its similarity to English This parallel also helps in understanding exactly what each command does and simplifies how to use the language 5 Powerful SASSi gives you the power to make statistical models a reality in just a few lines of code Easily Made Graphical Since SASSi is compiled into Java code creating a GUI is simple to do The user need not worry about creating any code for graphical representation The compiler knows how to represent everything and where to place what where All the user needs to do is choose what models he or she wishes to see Efficient The main goal of this language is to take the strain off of the user and the computer By keeping the libraries small and the manual compact anyone can use SASSi Using smaller libraries with SASSI allows the user to utilize more memory for the computations and other various tasks on his her computer The algorithms will also be efficient so as to maximize the utility of the computer Customizable Different aspects of SASSi s implementation are customizable The users will be able to design their own procedures and are encouraged to so If they aren t satisfied with the procedures given to them they can easily implement new procedures and not experience the headache of trying to find software that supports it Architecture SASSi code is compiled into Java byte code which Neutral makes it architecture neutral This means that SASSi can be developed on any platform that has the Java compiler the JVM and the GUI This will make distributing the software easier 1 3 Functionality Graphics SASSi offers several nice graphical options The users can decide how the results are seen The user can choose from a variety of formats including but not limited to bar chart pie chart and curves The users 6 also have an easy way of seeing the results in a text form This simplicity allows every onlooker to quickly understand what is going on with the statistics system and if their model is behaving the way that is desired Data Types SASSi will …
View Full Document
Unlocking...