1 / 17

VisualLISA

VisualLISA. Behind the Scenes. Universidade do Minho, Departamento de Informática Nuno Oliveira, 2008. Outline. Introduction Visual Language Grammar for VisualLISA DEViL Implementation Results. Universidade do Minho, Departamento de Informática Nuno Oliveira, 2008. 1. Introduction.

carver
Download Presentation

VisualLISA

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. VisualLISA BehindtheScenes Universidade do Minho, Departamento de Informática Nuno Oliveira, 2008

  2. Outline • Introduction • Visual LanguageGrammar for VisualLISA • DEViL • Implementation • Results Universidade do Minho, Departamento de Informática Nuno Oliveira, 2008 1

  3. Introduction • VisualLISAis a projectunderthe UCE-15 ofMScinInformatics’ 2nd year; • VisualLISAisa graphical interface for the compilers-compiler LISA. • VisualLISAwillbeused to edit visually LISA specifications. • Can’tVisualLISAbe a genericVisualAGtool? Universidade do Minho, Departamento de Informática Nuno Oliveira, 2008 2

  4. Visual LanguageGrammar • Differencesbetween visual and textual Grammars? • Operators to relate twoor more symbolsinspace; • Attributes to compute symbol’sposition; • Notionoforderofsymbol’soccurrence; Universidade do Minho, Departamento de Informática Nuno Oliveira, 2008 3

  5. Visual LanguageGrammar (…) AG_ELEM → LEFT_SYMBOL | NON_TERMINAL | TERMINAL | SYNT_ATTRIBUTE | INH_ATTRIBUTE | TREE_BRANCH | IV_ATTRIBUTE | SYNT_CONNECTION | INH_CONNECTION| IV_CONNECTION (…) TERMINAL → over( rect a ngle , text) (…) TREE BRANCH → points _from ( points _to (line , ˜TERMINAL) , ˜LEFT SYMBOL) | points _from ( points_ to( line, ˜NONTERMINAL) , ˜LEFT SYMBOL) 4

  6. DEViL– DevelopmentEnvironment for Visual Languages BadAspects GoodAspects ComplexInstallation; Disperse DocumentationandwritteninGerman; Generated Editor isonlycompatiblewiththe SO whereitisGenerated; ... Verygoodsupport; Toomuchexamples, addressingseveralDEViLfeatures; Exists for MacOS, Windows and Linux ... Universidade do Minho, Departamento de Informática Nuno Oliveira, 2008 5

  7. Implementation • Visual LanguageGrammarintoDEViLModelRepresentation • Editor Generation • SemanticAnalysis • CodeGeneration Universidade do Minho, Departamento de Informática Nuno Oliveira, 2008 6

  8. DEViLModelRepresentation

  9. Editor Generation • DefinitionofModels to createdifferentviews: • Define buttons’ Look & Feel; • Define buttons’ behavior; • ... • DefinitionofCanvas’ Look & Feel: • Assign Visual Patterns to eachgrammarSymbolorAttribute; • Define computations to implementthe Visual Patternassigned (ex: SYNT.drawing, SYNT.text, ...); • Calculatevalues for Symbols’ attributes; Universidade do Minho, Departamento de Informática Nuno Oliveira, 2008 8

  10. Editor Generation VIEW rootView ROOT Root { BUTTON IMAGE "img::btnSemprod" INSERTS Semprod INFO "Inserts a newGrammarProduction"; } SYMBOL rootView_Root INHERITS VPRootElement, VPForm COMPUTE SYNT.drawing = ADDROF(rootViewDrawing); END; SYMBOL rootView_Root_semprods INHERITS VPFormElement, VPSimpleList COMPUTE SYNT.formElementName = "productions"; END; 9

  11. SemanticAnalysis • DEViLbuilds a treerepresentation for ourspecification, basedonthegrammarspecified; • DEViLgivesus a sortof a treewalker to performcomputationsgiven a treecontext; • ThetreewalkerisnamedaddCheck • A treecontextisanysymbolorattributeinthetreerepresentation; Universidade do Minho, Departamento de Informática Nuno Oliveira, 2008 10

  12. SemanticAnalysis SemanticContraint: A productionmusthaveoneandonlyonerootsymbol checkutil::addCheckSemprod { setn [llength [c::getList {$obj.grammarElements.CHILDREN[LeftSymbol]}]] setsymbName [c::get {$obj.name.VALUE}] if { $n == 0 } { return "Production '$symbName' musthaveoneRootsymbol!" } elseif {$n > 1} { return "Production '$symbName' musthaveonlyoneRootsymbol!" } return ”” } 11

  13. CodeGeneration • Definitionofcode templates with IPTG/PTG files; • Definitionofcodegenerationusing LIDO files: • Use CONSTITUENTS to access/refer to symbolsfardownonthetreefromthe actual context; • Use INCLUDING* to access/refer to symbolsfaruponthetreefromthe actual context; • Use of SYNT attributes to calculatecodeorpartsofcode; * INCLUDING reducestheneedofusinginheritedattributes; Universidade do Minho, Departamento de Informática Nuno Oliveira, 2008 12

  14. CodeGeneration bnfProd(lhs, rhs): [lhs] -> [rhs] SYMBOL bnfgen_Semprod: bnfLHS : PTGNode; SYMBOL bnfgen_Semprod: bnfRHS : PTGNode; SYMBOL bnfgen_Semprod: bnfCode : PTGNode; SYMBOL bnfgen_Semprod COMPUTE SYNT.bnfLHS = CONSTITUENTS bnfgen_LeftSymbol.pers_symbolName WITH(PTGNode, PTGNewLineSeq, PTGAsIs, PTGNull); SYNT.bnfRHS = PTGAsIs(VLString(SELECT(vlList( "printBNFOrderedRHSElements",THIS.objId),eval()))); SYNT.bnfCode = PTGbnfProd(THIS.bnfLHS, THIS.bnfRHS); END; 13

  15. File Dependencies Viag.XMODEL Sync.TCL View.MODEL Edit.TCL View.LIDO Semantics.TCL images.GDR Buttons.PNG Code.MODEL Symbols.GIF Code.LIDO Viag.DEFS Code.SPECS Code.IPTG Aux.TCL Code.HEAD

  16. TheEditor

  17. THE END Universidade do Minho, Departamento de Informática Nuno Oliveira, 2008

More Related