npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

arith2js-gomez-enrique

v3.0.0

Published

* See section [Análisis Sintáctico Ascendente en JavaScript](http://crguezl.github.io/pl-html/node43.html) * The example working at [http://crguezl.github.io/jison-minus/](http://crguezl.github.io/jison-minus/)

Readme

Open in Codespaces

Lab Translating Arithmetic Expressions to JavaScript

Archivos de la práctica

  • Archivos de código:
    • ast-build.js : Archivo que contiene las funciones que crean los árboles de cada expresión permitida en la calculadora.
    • calc.js : archivo donde jison genera el parser.
    • grammar.jison : archivo que contiene la gramática de la calculadora.
    • lexer.l : archivo que contiene las expresiones regulares para leer los tokens.
    • support-lib.js : archivo que contiene funciones implementadas para realizar operaciones de la calculadora.
    • template.js : archivo con el template para calcular la ruta de donde se encuentra support-lib.js.
    • transpile.js : archivo con la funcion transpile y todas las necesarias para su funcionamiento.
    • calc2js.mjs : arhivo que contiene las opciones y comandos del ejecutable.
  • Archivos de test:

Dentro de la carpeta test se encuentran un archivo test.js que contiene el código para comparar en las pruebas, test-description.js que contiene los datos que se usan para cada prueba que se quiera hacer y una carpeta data que contiene todos los archivos de las 8 pruebas que se realizan para comprobar el correcto funcionamiento del programa.

  • Ejecución:
    • Para compilar el programa se debe de estar en la carpeta principal y ejecutar:
      npm run compile
    • Para ejecutar el programa y que muestre la salida por consola:
      ./bin/calc2js.mjs transpile <fichero>
      Se usa el comando 'transpile', que su finalidad es generar el código javaScript que genera el contenido del fichero que se le pasa. Por ello, se puede hacer un túnel con el comando node para ejecutar el resultado.
      ./bin/calc2js.mjs transpile <fichero> | node
      Si se quiere que la salida de la ejecución sea en un archivo, se usa la opción -o con el nombre del archivo
      ./bin/calc2js.mjs transpile <fichero_entrada> -o <fichero_salida>
      Aunque para hacer las dos cosas a la vez, se puede usar -v para que muestre el código por pantalla también
      ./bin/calc2js.mjs transpile <fichero_entrada> -v -o <fichero_salida>
    • Para ejecutar los test establecidos:
      npm run test
      Y si se quiere utilizar mocha:
      npm run testw

References