Created
March 16, 2016 13:22
-
-
Save Haylin-chama/4e532377370bd2fc054f to your computer and use it in GitHub Desktop.
Intento mediocre de Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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