01: // Autogenerated AST node
02: package org.python.parser.ast;
03:
04: import org.python.parser.SimpleNode;
05: import java.io.DataOutputStream;
06: import java.io.IOException;
07:
08: public class ImportFrom extends stmtType {
09: public String module;
10: public aliasType[] names;
11:
12: public ImportFrom(String module, aliasType[] names) {
13: this .module = module;
14: this .names = names;
15: }
16:
17: public ImportFrom(String module, aliasType[] names,
18: SimpleNode parent) {
19: this (module, names);
20: this .beginLine = parent.beginLine;
21: this .beginColumn = parent.beginColumn;
22: }
23:
24: public String toString() {
25: StringBuffer sb = new StringBuffer("ImportFrom[");
26: sb.append("module=");
27: sb.append(dumpThis(this .module));
28: sb.append(", ");
29: sb.append("names=");
30: sb.append(dumpThis(this .names));
31: sb.append("]");
32: return sb.toString();
33: }
34:
35: public void pickle(DataOutputStream ostream) throws IOException {
36: pickleThis(21, ostream);
37: pickleThis(this .module, ostream);
38: pickleThis(this .names, ostream);
39: }
40:
41: public Object accept(VisitorIF visitor) throws Exception {
42: return visitor.visitImportFrom(this );
43: }
44:
45: public void traverse(VisitorIF visitor) throws Exception {
46: if (names != null) {
47: for (int i = 0; i < names.length; i++) {
48: if (names[i] != null)
49: names[i].accept(visitor);
50: }
51: }
52: }
53:
54: }
|