All Packages Class Hierarchy This Package Previous Next Index
Class it.unipi.di.compass.cctwo.tree.Tree
java.lang.Object
|
+----it.unipi.di.compass.cctwo.tree.Tree
- public class Tree
- extends Object
I commenti in stile C e in stile C++ (// ... EOL) sono comunque ammessi.
Questa è la classe che effettua il parse e compila l'albero di
visualizzazione di CompAss.
La grammatica seguente definisce la struttura del file dell'albero:
<file> ::= { <tree> }+
<tree> ::= <node info> ( [<item list>] )
<item list> ::= <node info> [, <item list>] | <tree>
<node info> ::= < <node name> , <node label> , <icon open> , <icon close> >
<node name> ::= <string>
<node label> ::= <string>
<icon open> ::= <string>
<icon close> ::= <string>
Il parser non individua gli spazi come separatori, tutte le stringhe
vengono depurate dagli spazi in cima e in fondo alla stringa. <icon
open> e <icon close> sono i nomi delle icone associate
al nodo dell'albero quando è aperto e quando è chiuso. I nomi
delle icone sono da considerarsi senza estensione .gif automaticamente aggiunta
dal runtime.
Il file prodotto in output ha il seguente formato:
<file> ::= <string table> <trees>
<string table> ::= <table sz> { <string> }*
<string> ::= <length> { <char> }*
<trees> ::= <tree num> { <tree> }*
<tree> ::= <name ref> <icon open ref> <icon close ref> <tree num> { <tree> }*
I campi, stringhe escluse, sono tutti di due bytes prodotti con
ItemBase.encode/decode. Le stringhe sono scritte/lette con
ItemBase.writeString/readString.
- Version:
- 1.0
- Author:
- Antonio Cisternino
-
rootName
- Nome del nodo radice (la foresta viene vista come figli
di questo nodo).
-
Tree()
-
-
parseAndGenerateDisplayTree(DataOutputStream, Reader)
- Effettua il parse del file sorgente letto da uno stream in
input.
rootName
protected static String rootName
- Nome del nodo radice (la foresta viene vista come figli
di questo nodo).
Tree
public Tree()
parseAndGenerateDisplayTree
public static NodeNames parseAndGenerateDisplayTree(DataOutputStream out,
Reader in) throws IOException, ParserException
- Effettua il parse del file sorgente letto da uno stream in
input.
- Parameters:
- out - Stream su cui salvare l'albero di visualizzazione.
- in - Stream da cui leggere il sorgente.
- Returns:
- Restituisce la tabella dei nomi dei nodi di visualizzazione.
- Throws: IOException
- Indica problemi di lettura
della sorgente o di scrittura
del file Item.java.
- Throws: ParserException
- Indica un errore
di parsing.
- See Also:
- SymbolTable, TTokenizer, TParser, IdeDescriptor
All Packages Class Hierarchy This Package Previous Next Index