DOC PREVIEW
Columbia COMS W4115 - ScriptEdit Language Reference Manual

This preview shows page 1-2-3-4-5-6-41-42-43-44-45-46-84-85-86-87-88-89 out of 89 pages.

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

Unformatted text preview:

IntroductionDescriptionLanguage TutorialGetting StartedHow to run ScriptEditExamples of simple ScriptEdit programsExample 1: using def command to run HelloWorld.html.seExample 2: My first ScriptEdit pageExample 3: Creating a functionExample 4:Language Reference ManualMain lexical conventionsString constantsCommentsIdentifiers (Names)Keywords, declaration and content operatorsConditionsOther tokensStatementsSemanticsVariable declarationFunction declarationVariable callFunction callFile include#if and #else#while#for, #next, #do#exec#calc#gettoken#write Project PlanProcesses used for planning, specifications, development, testingProgramming style guideProject timelineRoles and responsibilitiesEnvironmentProject logSettling on an IdeaCreating Roles and responsibilitiesDetermine tools and setupConceptualization, General Language behaviorLanguage Reference ManualParser codingTestingTreewalker codingLanguage codingArchitectural DesignTest PlanTest CodeTest SuitesTest AutomationLessons LearnedIndividual Team Member CommentsDeni:Marc:Bhavesh:Bethany:CodeScriptEditMain.javaSimpTreeWalker.gSEgen.javaOutputMethods.javaTesting calc.txt.se def.txt.seexec_python.txt.se exec.txt.se file.txt.se func.txt.se gettoken.txt.se if1.txt.se if.txt.se scoping.txt.se stringconst1.txt.se while.txt.seScriptEdit Language Reference ManualBhavesh [email protected] M. [email protected] [email protected] [email protected] 8, 20072Chapter 1Introduction1.1 DescriptionScriptEdit is a language that allows you to automatically generate text from alimited set of instructions. You can write new files with this text, or insert itinto an existing file. The instructions may use the text of the edited file, externalfiles, or text generated by other standard input/output based applications asinput. ScriptEdit is similar to a macro processor in the sense that it replace stext with other text, but it can also create new files from a single source.Motivations and Goals: The main goal of this language is to allow theuser to edit files and the script operations that are needed to create their con-tent all from within one single source file. Often, editing content text files(HTML, LATEX, XML, etc) is a process that involves several different steps andprograms—like separate bash scripts, a text editor, and other console programs(e.g., using ImageMagick to edit images or using Matlab to create graphs thatwill be linked). ScriptEdit is a way to put all those different process calls to-gether with the content text file.Some advantages of scripting operations within the source content file:Visualization Contents and related scripts are written in the same area soit’s easy to check that they are coherent using standard editors.Inline execution of associated scripts If a long set of programs have to beexecuted each time, normally a shell script grouping them is created and thenexecuted, but then new users that edit the file should be aware that this fileshould be executed and will have to figure out if the s cript has to be run before34 CHAPTER 1. INTRODUCTIONor after editing some files. Sometimes, the process can be tedious and hard toreproduce like run program1, edit file1, run program2, edit file2. So ScriptEditeases this task by running the scripts and outputting the text at the same timein the right order. Moreover modifications of the format of the input file arealso more easily synchronized with the script.Templates and macros are easy Some languages like C already have a goodpreprocessor that allows using templates—#include, #ifdef, etc—but otherslike HTML or XML don’t, and users are asking for them. Macros are normallyplaced in the editor but each editor uses different implementations of them, soyou have to learn multiple ways to do the same.Other languages have already been built to solve this sort of problem. In the par-ticular case of processing HTML text files: HTP (http://htp.sourceforge.net/) and HPP (http://citeseer.ist.psu.edu/douglis97hpp.html) are goodexamples, but they are more specialized than what we have in mind. Perhaps amore comparable existing language is M4 (www.gnu.org/software/m4).Chapter 2Language Tutorial2.1 Getting Starte dThis short tutorial can b e used to quickly familiarize yourself with ScriptEdit.The first step is to ensure that you have properly installed the environmentneeded to run ScriptEdit code. Second, we will look at the most basic examplesof ScriptEdit code. Finally, we will walk through a more complex ScriptEditexample.1. Check Environment: Ensure Java and ANTLR are properly installedTo begin using ScriptEdit, you will need to do the following:2. uncompress the source archive into an empty directory3. ensure that you have a JDK version 1.4 or above4. verify that ANTLR is available and can be run with the command antlr5. make sure the current directory and antlr.jar are in the CLASSPATH6. compile the source code to create the Java code for the translator’s scan-ner and parser from Simplexer.g, and compile the ANTLR-generated filesalong with the rest of the ScriptEdit Java code into .class files and aScriptEdit.jar file.$javac d /scriptedit *.java2.2 How to run ScriptEditCheck that ScriptEdit.class and antlr.jar are in your class path and type thefollowing commands at the command prompt to create output from .se input56 CHAPTER 2. LANGUAGE TUTORIALfiles:$java Main <SOURCE><SOURCE>: Is the ScriptEdit source file. ScriptEdit will only allow one in-put file for a source. If needed, ScriptEdit allows for other files to be embeddedwithin the SOURCE by using the #file statement (see LRM). Source files s houldbe a plain text format that ends with a .se extention. Upon succes sful compi-lation, ScriptEdit will create (or replace) an output file with of the same nameas the source file without the .se extension. myScriptEditCode.html.se − >myScriptEditCode.html2.3 Examples of simple ScriptEdit program sScriptEdit code can be written using any text editor software. The examplesbelow will help familiarize you with some basic ScriptEdit syntax and allow youto quickly begin creating your own sciptEdit code. The first example is theclassic hello world. A variable is created to hold a string “hello world” and thenoutput using the write command.2.3.1 Example 1: using def command to r un HelloWorld.html.se<html><!--simple hello world program:-->#def(greeting){hello world!}$(greeting)</html>$java Min HelloWorld.html.seOUTPUT FILE:


View Full Document

Columbia COMS W4115 - ScriptEdit Language Reference Manual

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
Download ScriptEdit Language Reference Manual
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view ScriptEdit Language Reference Manual 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 ScriptEdit Language Reference Manual 2 2 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?