DOC PREVIEW
Columbia COMS W4115 - The MRRoboto Language

This preview shows page 1-2-3 out of 10 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 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 10 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 10 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

The MRRoboto LanguageThe MRRoboto LanguageJason KopylecJason KopylecHema KrishnanHema KrishnanAdam MarczykAdam MarczykProgramming LanguagesProgramming LanguagesSpring 2004Spring 2004The InspirationThe InspirationnnIn most operating systems, writing In most operating systems, writing programs that interact with other programs programs that interact with other programs is difficult.is difficult.nnGraphical user interfaces are designed for Graphical user interfaces are designed for humans, not programs.humans, not programs.nnThere are many conceivable situations for There are many conceivable situations for which it would be nice to be able to control which it would be nice to be able to control other programs programmatically.other programs programmatically.nnSolution: Control the keyboard and the Solution: Control the keyboard and the mouse through software.mouse through software.The ConceptThe ConceptnnThe Macro Record Robot Language The Macro Record Robot Language (MRRoboto for short) allows programmers (MRRoboto for short) allows programmers to automate control of the keyboard and the to automate control of the keyboard and the mouse through simple batch programs.mouse through simple batch programs.nnThe syntax is JavaThe syntax is Java--like, but simplified so like, but simplified so that scripts can be written quickly. that scripts can be written quickly. nnA good way to teach beginning A good way to teach beginning programmers basic concepts such as flow programmers basic concepts such as flow control and modularization.control and modularization.The ExecutionThe ExecutionnnThe ANTLR parser generator was used to The ANTLR parser generator was used to create a grammar file that translates create a grammar file that translates MRRoboto scripts into humanMRRoboto scripts into human--readable readable Java source code which can then be Java source code which can then be compiled and run.compiled and run.nnTranslation consists of three steps: lexical Translation consists of three steps: lexical analysis, syntax tree generation, and a treeanalysis, syntax tree generation, and a tree--walking algorithm that performs semantic walking algorithm that performs semantic analysis and generates the code.analysis and generates the code.Some ExamplesSome Examples** a simple hello world program** a simple hello world programmouseMove(10, 10)mouseMove(10, 10)click()click()mouseMove(50, 10)mouseMove(50, 10)click()click()type("notepad")type("notepad")press("|ENTER|")press("|ENTER|")type("Hello World")type("Hello World")More ExamplesMore Examples** delays and flow control** delays and flow controlint aint aa = 3a = 3wait(60000) **60 secondswait(60000) **60 secondsif(a < 10)if(a < 10)moveAndDoubleClick(20,20)moveAndDoubleClick(20,20)elseelsewhile(a < 5)while(a < 5)moveAndClick(50,50)moveAndClick(50,50)endendendendThe Main Block and ProceduresThe Main Block and Proceduresstring bstring bb = "foo"b = "foo"doType(b)doType(b)procedure doType(string msg)procedure doType(string msg)type(msg)type(msg)endendError Detection and RecoveryError Detection and RecoverynnCode that violates the grammar rules (bad Code that violates the grammar rules (bad token, incorrect syntax, etc.) will be token, incorrect syntax, etc.) will be detected by ANTLR during initial lexical detected by ANTLR during initial lexical analysis and parsing.analysis and parsing.nnCode that contains semantic errors Code that contains semantic errors (undefined symbol, type mismatch, missing (undefined symbol, type mismatch, missing return statement, etc.) will be detected by return statement, etc.) will be detected by the semantic analyzer during the final stage the semantic analyzer during the final stage of translation.of translation.Future Directions…Future Directions…nnWe had relatively little time to implement We had relatively little time to implement computercomputer--vision functionality, other than vision functionality, other than some simple pixel color detection, so the some simple pixel color detection, so the ability of MRRoboto programs to actually ability of MRRoboto programs to actually interact with the screen is fairly limited.interact with the screen is fairly limited.nnMore sophisticated means of interaction, More sophisticated means of interaction, perhaps including automatic detection of perhaps including automatic detection of systemsystem--native windowing components, native windowing components, seems to be a likely place for future seems to be a likely place for future


View Full Document

Columbia COMS W4115 - The MRRoboto Language

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 The MRRoboto Language
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 The MRRoboto Language 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 The MRRoboto Language 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?