Artigos
URI permanente para esta coleçãohttps://locus.ufv.br/handle/123456789/11798
Navegar
Item The formalization and implementation of Adaptable Parsing Expression Grammars(Science of Computer Programming, 2014-12-15) Iorio, Vladimir O. Di; Reis, Leonardo V. S.; Bigonha, Roberto S.; Amorim, Luis Eduardo S.The term “extensible language” is especially used when a language allows the extension of its own concrete syntax and the definition of the semantics of new constructs. Most popular tools designed for automatic generation of syntactic analysers do not offer any adequate resources for the specification of extensible languages. When used in the implementation of features like syntax macro definitions, these tools usually impose severe restrictions. For example, it may be required that macro definitions and their use reside in different files; or it may be impossible to perform the syntax analysis in one single pass. We claim that one of the main reasons for these limitations is the lack of appropriate formal models for the definition of the syntax of extensible languages. This paper presents the design and formal definition of Adaptable Parsing Expression Grammars, an extension to the Parsing Expression Grammar (PEG) model that allows the manipulation of its own production rules during the analysis of an input string. The proposed model compares favourably with similar approaches for the definition of the syntax of extensible languages. An implementation of the model is also presented, simulating the behaviour of packrat parsers. Among the challenges for this implementation is the use of attributes and on the fly modifications on the production rules at parse time, features not present in standard PEG. This approach has been used on the definition of a real extensible language, and initial performance tests suggest that the model may work well in practice.Item An on-the-fly grammar modification mechanism for composing and defining extensible languages(Computer Languages, Systems & Structures, 2015-07) Reis, Leonardo V. S.; Di Iorio, Vladimir O.; Bigonha, Roberto S.Adaptable Parsing Expression Grammar (APEG) is a formal method for defining the syntax of programming languages. It provides an on-the-fly mechanism to perform modifications of the syntax of the language during parsing time. The primary goal of this dynamic mechanism is the formal specification and the automatic parser generation for extensible languages. In this paper, we show how APEG can be used for the definition of the extensible languages SugarJ and Fortress, clarifying many aspects of the syntax of these languages. We also show that the mechanism for on-the-fly modification of syntax rules can be useful for defining grammars in a modular way, implementing almost all types of language composition in the context of specification of extensible languages.Item What’s the name of the game? Formal Specification of Artificial Intelligence Games(Electronic Notes in Theoretical Computer Science, 2015-05-12) Iorio, Vladimir Di; Bigonha, Roberto S.; Bigonha, Mariza A. S.; Oliveira, Alcione; Miguel, EliseuArtificial intelligence games are a very interesting tool for teaching Artificial Intelligence techniques. Competitors write programs for agents, which are supposed to complete a given task or fight against other agents. In order to achieve the best performance, programs may have to use advanced Artificial Intelligence methods. In this paper, we present a framework to build artificial intelligence games, using Abstract State Machines (ASM) for the specification of the rules of the games. Choosing ASM, we expect that the competitors will be able to understand clearly the semantics of the rules. The framework includes a compiler for an ASM-based language, allows complete control of the order of execution of agents and easy integration with graphical libraries.Item What's the name of the game? Formal specification of artificial intelligence games(Electronic Notes in Theoretical Computer Science, 2005-05-12) Oliveira, Alcione; Miguel, Eliseu; Bigonha, Roberto S.; Bigonha, Mariza A. S.; Di Iorio, VladimirArtificial intelligence games are a very interesting tool for teaching Artificial Intelligence techniques. Competitors write programs for agents, which are supposed to complete a given task or fight against other agents. In order to achieve the best performance, programs may have to use advanced Artificial Intelligence methods. In this paper, we present a framework to build artificial intelligence games, using Abstract State Machines (ASM) for the specification of the rules of the games. Choosing ASM, we expect that the competitors will be able to understand clearly the semantics of the rules. The framework includes a compiler for an ASM-based language, allows complete control of the order of execution of agents and easy integration with graphical libraries.