projects
/
PL2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Acceso a clase
[PL2.git]
/
Modulo.java
diff --git
a/Modulo.java
b/Modulo.java
index
a0468ed
..
e0ced5d
100644
(file)
--- a/
Modulo.java
+++ b/
Modulo.java
@@
-6,6
+6,7
@@
public class Modulo {
String nombre;
AST exportacion;
AST importacion;
String nombre;
AST exportacion;
AST importacion;
+ AST implementacion;
public Modulo(String nombre, AST arbol){
this.nombre = nombre;
public Modulo(String nombre, AST arbol){
this.nombre = nombre;
@@
-22,6
+23,10
@@
public class Modulo {
ASTFactory f = new ASTFactory();
this.importacion = f.dupTree(t);
}
ASTFactory f = new ASTFactory();
this.importacion = f.dupTree(t);
}
+ if(t.getText().equals("implementacion")){
+ ASTFactory f = new ASTFactory();
+ this.implementacion = f.dupTree(t);
+ }
t = t.getNextSibling();
}
}
t = t.getNextSibling();
}
}
@@
-47,6
+52,17
@@
public class Modulo {
}
return arbol;
}
}
return arbol;
}
+
+ public AST getDeclaracion_interna(String nombre){
+ AST arbol = implementacion.getFirstChild();
+ while(!arbol.getFirstChild().getText().equals(nombre)){
+ arbol = arbol.getNextSibling();
+ if (arbol == null)
+ break;
+ }
+ return arbol;
+ }
+
public AST getImportacion(){
return importacion;
}
public AST getImportacion(){
return importacion;
}