270 likes | 383 Views
VisualLISA presents a novel approach to the conception and development of a visual language designed for Attribute Grammar (AG) specification. The project encompasses multiple phases including formalization, idealization, and implementation, aiming to reduce the mental effort associated with specifying AGs. Utilizing generators like DEViL, VisualLISA allows for visual editing and generates code in various formats such as LISA, XML, and BNF. This systematic development leads to an intuitive graphical front-end, enhancing user experience and facilitating the syntax and semantic checking of AG models.
E N D
VisualLISA AttributeGrammarsmadeeasy... Author Context Institution Presentation Universityof Minho UCE-15, MasterinInformatics Nuno Oliveira, nuno43549@gmail.com
TheProblem • Conceptionof a Visual Language; • Developmentof a Processor for theLanguage; • Idealizationofthe Visual Language; • Formalizationofthelanguage; • Concretizationoftheinitialidea;
Let’sget to Business! • VisualLISA Analysis • DomainAnalysis • VL Formal Notations • VPE generators • Implementation
VisualLISA Analysis • VisualLISA – a graphicalfront-end for LISA (anAG-basedcompilergenerator); • Visual EditionofAttributeGrammars (production-oriented); • Aimsatreducing mental effortwhenspecifyingAGs; • Performssyntaxandsemanticcheckofthe AG modeldrawn; • Generates code (LISA, XML, BNF) fromthedrawings; • The environment shouldbeautomaticandsystematicallygeneratedresorting to a VPE generator
DomainSpecificProblem • Theknowladgeabout AG wasnotenough; • Decicion: Search for AG domainknowledgeuntiltheendoftheworld; • When I getback: Deepundertstandingabout AG;
VL Formal Notations • Twowerefound: MASOViLAand PLG; • PLG waschosen: • IssimplerthanMASOViLA; • Closer to BNF usual notation; TERMINAL → over ( rectangle, text) TREE_BRANCH → points_from ( points_to (line, ~TERMINAL) , ~LEFT_SYMBOL) | points_from ( points_to ( line, ˜NONTERMINAL) , ~LEFT SYMBOL)
VPE Generators • Several VPE generatorshavebeenstudied: • DEViL • VLDesk • Tiger • ... • DEViL waschosen: • Basedon Modular SymbolOriented AG Specifications; • Generated environment is complete butextensible; • Stand-alone environment for themostimportantSOs; • ...
Implementation • TheDevelopmentProcess • AbstractSyntaxDefinition; • InteractionandLayoutDefinition; • SemanticsVerificationImplementation; • CodeGeneration.
SystematicDevelopment Systematization VisualLISA AbstractSyntax Definition Code Generation TG Semantics Implementation TG module Interaction&Layout Definition TW module TG TG module
Scene 1 • TheDevelopmentProcess • AbstractSyntaxDefinition; • InteractionandLayoutDefinition; • SemanticsVerificationImplementation; • CodeGeneration.
AbstractSyntaxDefinition AbstractSyntax Definition TreeGrammar (TG) Join&Transform PLG TERMINAL → over ( rectangle, text) (…) Structure Definition CLASS Root { name: VAL VLString; semprods: SUB Semprod*; definitions: SUB Definitions!; library: SUB Library?; } ...
SystematicDevelopment (2) Systematization VisualLISA AbstractSyntax Definition Code Generation TG Semantics Implementation TG module Interaction&Layout Definition TW module TG TG module
Scene 2 • TheDevelopmentProcess • AbstractSyntaxDefinition; • InteractionandLayoutDefinition; • SemanticsVerificationImplementation; • CodeGeneration.
Interaction & LayoutDefinition Interaction&Layout Definition TG module Join&Transform Views Definition VIEW rootView ROOT Root { BUTTON IMAGE "img::btnSemprod” INSERTS Semprod INFO "Inserts a newProduction"; } Symbols Definition SYMBOL rootView_Root INHERITS VPRootElement, VPForm COMPUTE SYNT.drawing = ADDROF(rootViewDrawing); END; SYMBOL rootView_Root_semprods INHERITS VPFormElement, VPSimpleList COMPUTE SYNT.formElementName = "productions"; END;
SystematicDevelopment (3) Systematization VisualLISA DEViL AbstractSyntax Definition Code Generation TG Semantics Implementation TG module Interaction&Layout Definition TW module TG TG module
Scene 3 • TheDevelopmentProcess • AbstractSyntaxDefinition; • InteractionandLayoutDefinition; • SemanticsVerificationImplementation; • CodeGeneration.
SemanticsImplementation Semantics Implementation TW TG module TCL_programming Formal Constraints checkutil::addCheckSemprod { setn [llength [c::getList {$obj.grammarElements.CHILDREN[LeftSymbol]}]] setsymbName [c::get {$obj.name.VALUE}] if { $n == 0 } { eturn "Production '$symbName' musthaveoneRootsymbol!” } elseif {$n > 1} { return "Production '$symbName' musthaveonlyoneRootsymbol!” } return ”” } • A productionmusthaveoneandonlyonerootsymbol; • (...) =>
Scene 4 • TheDevelopmentProcess • AbstractSyntaxDefinition; • InteractionandLayoutDefinition; • SemanticsVerificationImplementation; • CodeGeneration.
CodeGeneration CodeGeneration TG module Join&Transform Auxiliary Functions Translation Templates LISA, XAGra, BNF 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; bnfProd(lhs, rhs): [lhs] -> [rhs]
SystematicDevelopment (4) Systematization VisualLISA DEViL AbstractSyntax Definition Code Generation TG Semantics Implementation TG module Interaction&Layout Definition TW module TG TG module
Example LISA • GenerationofCodeFromthe AG Drawn • LISA • Generates XAGra XAGra
OneStep More • RequirementsAnalysis • DomainAnalysis • VL Formal Notations • VPE generators • Implementation • Dissemination
Dissemination • Website developed : www.di.uminho.pt/~gepl/VisualLISA • Complete TechnicalReportwritten • Paperssubmited to InternationalConferences • SeveralTalks weregiven.
ConclusionandFutureWork • VisualLISA reallyworks! • The use ofan environment generatorallows a systematicdevelopment; • Maintainingandevolvingthe modules iseasy; • Itlacksanusabilitytest to confirmwhether VisualLISA easesornotthespecificationof AG;
VisualLISA www.di.uminho.pt/~gepl/VisualLISA