Skip to main content

Showing 1–13 of 13 results for author: Mascarenhas, F

Searching in archive cs. Search in all archives.
.
  1. Towards Automatic Error Recovery in Parsing Expression

    Authors: Sérgio Queiroz de Medeiros, Fabio Mascarenhas

    Abstract: Error recovery is an essential feature for a parser that should be plugged in Integrated Development Environments (IDEs), which must build Abstract Syntax Trees (ASTs) even for syntactically invalid programs in order to offer features such as automated refactoring and code completion. Parsing Expressions Grammars (PEGs) are a formalism that naturally describes recursive top-down parsers using a… ▽ More

    Submitted 4 July, 2025; originally announced July 2025.

    Comments: arXiv admin note: substantial text overlap with arXiv:1905.02145

    ACM Class: F.4.3; D.3.1; D.3.4

  2. arXiv:2109.09523  [pdf, ps, other

    cs.DS

    Solving systems of inequalities in two variables with floating point arithmetic

    Authors: Walter F. Mascarenhas

    Abstract: From a theoretical point of view, finding the solution set of a system of inequalities in only two variables is easy. However, if we want to get rigorous bounds on this set with floating point arithmetic, in all possible cases, then things are not so simple due to rounding errors. In this article we describe in detail an efficient data structure to represent this solution set and an efficient and… ▽ More

    Submitted 20 September, 2021; originally announced September 2021.

  3. arXiv:2109.07838  [pdf, ps, other

    cs.CG

    Computing the exact sign of sums of products with floating point arithmetic

    Authors: Walter F. Mascarenhas

    Abstract: IIn computational geometry, the construction of essential primitives like convex hulls, Voronoi diagrams and Delaunay triangulations require the evaluation of the signs of determinants, which are sums of products. The same signs are needed for the exact solution of linear programming problems and systems of linear inequalities. Computing these signs exactly with inexact floating point arithmetic i… ▽ More

    Submitted 17 September, 2021; v1 submitted 16 September, 2021; originally announced September 2021.

    Comments: In this second version we fix some typos and provide a more precise description of the conditions under which our main algorithm is valid. We also rewrote the algorithm in order to make it more clear. We also make the C++ code mentioned in the article available as supplementary material on the arxiv

  4. arXiv:1905.02145  [pdf, ps, other

    cs.PL cs.FL

    Automatic Syntax Error Reporting and Recovery in Parsing Expression Grammars

    Authors: Sérgio Queiroz de Medeiros, Gilney de Azevedo Alvez Junior, Fabio Mascarenhas

    Abstract: Error recovery is an essential feature for a parser that should be plugged in Integrated Development Environments (IDEs), which must build Abstract Syntax Trees (ASTs) even for syntactically invalid programs in order to offer features such as automated refactoring and code completion. Parsing Expressions Grammars (PEGs) are a formalism that naturally describes recursive top-down parsers using a… ▽ More

    Submitted 1 October, 2019; v1 submitted 6 May, 2019; originally announced May 2019.

    ACM Class: D.3.4; D.3.1

  5. Syntax Error Recovery in Parsing Expression Grammars

    Authors: Sérgio Medeiros, Fabio Mascarenhas

    Abstract: Parsing Expression Grammars (PEGs) are a formalism used to describe top-down parsers with backtracking. As PEGs do not provide a good error recovery mechanism, PEG-based parsers usually do not recover from syntax errors in the input, or recover from syntax errors using ad-hoc, implementation-specific features. The lack of proper error recovery makes PEG parsers unsuitable for using with Integrated… ▽ More

    Submitted 28 June, 2018; originally announced June 2018.

    Comments: Published on ACM Symposium On Applied Computing 2018

  6. arXiv:1802.08558  [pdf, other

    cs.MS math.NA

    Moore: Interval Arithmetic in C++20

    Authors: Walter F. Mascarenhas

    Abstract: This article presents the Moore library for interval arithmetic in C++20. It gives examples of how the library can be used, and explains the basic principles underlying its design.

    Submitted 21 February, 2018; originally announced February 2018.

    Comments: arXiv admin note: text overlap with arXiv:1611.09567"

  7. arXiv:1706.02400  [pdf, ps, other

    cs.PL

    Decoding Lua: Formal Semantics for the Developer and the Semanticist

    Authors: Mallku Soldevila, Beta Ziliani, Bruno Silvestre, Daniel Fridlender, Fabio Mascarenhas

    Abstract: We provide formal semantics for a large subset of the Lua programming language, in its version 5.2. We validate our model by mechanizing it and testing it against the test suite of the reference interpreter of Lua, confirming that our model accurately represents the language. In addition, we set us an ambitious goal: to target both a PL semanticist ---not necessarily versed in Lua---, and a Lua de… ▽ More

    Submitted 7 June, 2017; originally announced June 2017.

  8. arXiv:1611.09567  [pdf, other

    cs.MS

    Moore: Interval Arithmetic in Modern C++

    Authors: Walter F. Mascarenhas

    Abstract: We present the library Moore, which implements Interval Arithmetic in modern C++. This library is based on a new feature in the C++ language called concepts, which reduces the problems caused by template meta programming, and leads to a new approach for implementing interval arithmetic libraries in C++.

    Submitted 29 November, 2016; originally announced November 2016.

  9. arXiv:1606.06508  [pdf, ps, other

    cs.CG

    Fast and accurate normalization of vectors and quaternions

    Authors: Walter F. Mascarenhas

    Abstract: We present fast and accurate ways to normalize two and three dimensional vectors and quaternions and compute their length. Our approach is an adaptation of ideas used in the linear algebra library LAPACK, and we believe that the computational geometry and computer aided design communities are not aware of the possibility of speeding up these fundamental operations in the robust way proposed here.

    Submitted 16 January, 2018; v1 submitted 21 June, 2016; originally announced June 2016.

    Comments: In this version I fixed some minor details in the text and moved all tables to the experiments section

  10. arXiv:1405.6646  [pdf, ps, other

    cs.PL cs.FL

    Error Reporting in Parsing Expression Grammars

    Authors: André Murbach Maidl, Sérgio Medeiros, Fabio Mascarenhas, Roberto Ierusalimschy

    Abstract: Parsing Expression Grammars (PEGs) describe top-down parsers. Unfortunately, the error-reporting techniques used in conventional top-down parsers do not directly apply to parsers based on Parsing Expression Grammars (PEGs), so they have to be somehow simulated. While the PEG formalism has no account of semantic actions, actual PEG implementations add them, and we show how to simulate an error-repo… ▽ More

    Submitted 13 July, 2016; v1 submitted 26 May, 2014; originally announced May 2014.

    Comments: Preprint (plus appendix) submitted to Science of Computer Programming

  11. On the Relation between Context-Free Grammars and Parsing Expression Grammars

    Authors: Fabio Mascarenhas, Sérgio Medeiros, Roberto Ierusalimschy

    Abstract: Context-Free Grammars (CFGs) and Parsing Expression Grammars (PEGs) have several similarities and a few differences in both their syntax and semantics, but they are usually presented through formalisms that hinder a proper comparison. In this paper we present a new formalism for CFGs that highlights the similarities and differences between them. The new formalism borrows from PEGs the use of parsi… ▽ More

    Submitted 13 February, 2014; v1 submitted 10 April, 2013; originally announced April 2013.

  12. From Regexes to Parsing Expression Grammars

    Authors: Sérgio Medeiros, Fabio Mascarenhas, Roberto Ierusalimschy

    Abstract: Most scripting languages nowadays use regex pattern-matching libraries. These regex libraries borrow the syntax of regular expressions, but have an informal semantics that is different from the semantics of regular expressions, removing the commutativity of alternation and adding ad-hoc extensions that cannot be expressed by formalisms for efficient recognition of regular languages, such as determ… ▽ More

    Submitted 17 October, 2012; originally announced October 2012.

  13. Left Recursion in Parsing Expression Grammars

    Authors: Sérgio Medeiros, Fabio Mascarenhas, Roberto Ierusalimschy

    Abstract: Parsing Expression Grammars (PEGs) are a formalism that can describe all deterministic context-free languages through a set of rules that specify a top-down parser for some language. PEGs are easy to use, and there are efficient implementations of PEG libraries in several programming languages. A frequently missed feature of PEGs is left recursion, which is commonly used in Context-Free Grammars… ▽ More

    Submitted 13 February, 2014; v1 submitted 2 July, 2012; originally announced July 2012.

    Comments: Extended version of the paper "Left Recursion in Parsing Expression Grammars", that was published on 2012 Brazilian Symposium on Programming Languages