Skip to content

Instantly share code, notes, and snippets.

@Haylin-chama
Created March 16, 2016 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Haylin-chama/4e532377370bd2fc054f to your computer and use it in GitHub Desktop.
Save Haylin-chama/4e532377370bd2fc054f to your computer and use it in GitHub Desktop.
Intento mediocre de Java
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication1algo;
import java.util.*;
/**
*
* @author Una Haylina
*/
public class JavaApplication1algo {
public static void main(String[] args) {
List<String> alfabeto = new ArrayList<String>();
List<String> noTerminales = new ArrayList<String>();
Map<String, List> producciones =
new HashMap<String, List>();
alfabeto.add("a");
alfabeto.add("b");
noTerminales.add("S");
noTerminales.add("A");
String simboloInicial = "S";
producciones.put("S", new ArrayList<String>());
producciones.get("A").add("bA");
producciones.get("A").add("b");
System.out.println("Gramatica");
System.out.println("Alfabeto: " +alfabeto);
System.out.println("No Terminales: " +noTerminales);
System.out.println("Simbolo Inicial: " +simboloInicial);
System.out.println("Producciones: " +producciones);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment