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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@alu0100973914/infix2egg-in-jison

v1.0.1

Published

[![Build Status](https://travis-ci.com/ULL-ESIT-PL-1718/infix-to-egg-alu0100973914.svg?token=S9Gezg46GoVeGRv4GwA9&branch=master)](https://travis-ci.com/ULL-ESIT-PL-1718/infix-to-egg-alu0100973914) [![npm version](https://badge.fury.io/js/%40alu0100973914%

Readme

Practice 9 of PL: Infix to Egg in Jison (i2eij)

Build Status npm version

Egg repository

Infix to Egg repository

Compatibilities

Infix to Egg in Jison has the same features than Infix to Egg. The same tests created for testing Infix to Egg behaviour are passed by Infix to Egg in Jison (51/51):+1:.

Grammar

Jison grammar with semantic actions can be found in the file i2e-parser.jison of the lib folder. To generate the parser try the command below:

jison lib/i2e-parser.jison -o lib/i2e-parser.js

Jison file without semantic actions

%lex
%%

(\s+|"//".*|"/*"[^]*?"*/")                 /* whitespace */
[-+]?[0-9]*"."?[0-9]+([eE][+-]?[0-9]+)?    return 'NUMBER'
"\"".*?"\""                                return 'STRING'
("true"|"false")                           return 'LOGICVALUE'
("&&"|"||")                                return 'LOGOP'
("<"|">"|"=="|"<="|">=")                   return 'COMPOP'
("+"|"-")                                  return 'ADDOP'
("*"|"/")                                  return 'MULOP'
"("                                        return 'LP'
")"                                        return 'RP'
"{"                                        return 'LB'
"}"                                        return 'RB'
","                                        return 'COMMA'
";"                                        return 'SEMICOLON'
"="                                        return 'ASSIGN'
"var"                                      return 'KW_VAR'
"function"                                 return 'KW_FUNCTION'
"if"                                       return 'KW_IF'
"else"                                     return 'KW_ELSE'
"while"                                    return 'KW_WHILE'
[^\s(){},"'?:;]+                           return 'WORD'
<<EOF>>                                    return 'EOF'
/lex

/* operator associations and precedence */

%right 'ASSIGN'
%left  'LOGOP'
%left  'COMPOP'
%left  'ADDOP'
%left  'MULOP'

%start program

%% /* language grammar */

program
    : statements EOF
    ;

statements
    : statements statement
    | statement
    ;

statement
    : declaration
    | assignment
    | conditional
    | function_call
    | function
    | loop
    ;

declaration
    : KW_VAR assignment
    ;

assignment
    : WORD ASSIGN expr SEMICOLON
    | WORD ASSIGN anonym_function
    ;

anonym_function
    : KW_FUNCTION LP arguments_list RP block
    | KW_FUNCTION LP RP block
    ;

function_call
    : WORD LP arguments_list RP SEMICOLON
    | WORD LP RP SEMICOLON
    ;

function
    : KW_FUNCTION WORD LP arguments_list RP block
    | KW_FUNCTION WORD LP RP block
    ;

arguments_list
    : expr
    | arguments_list COMMA expr
    ;

block
    : LB statements RB
    ;

conditional
    : KW_IF LP expr RP block
    | KW_IF LP expr RP block KW_ELSE block
    | KW_IF LP expr RP block KW_ELSE conditional
    ;

loop
    : KW_WHILE LP expr RP block
    ;

expr
    : comp_expr
    | expr LOGOP comp_expr
    ;

comp_expr
    : ar_expr
    | comp_expr COMPOP ar_expr
    ;

ar_expr
    : product
    | ar_expr ADDOP product

    ;

product
    : final_expression
    | product MULOP final_expression
    ;

final_expression
    : LP expr RP
    | WORD
    | NUMBER
    | STRING
    | LOGICVALUE
    ;