private IfStatement?GetElif(SuiteStatement s)
 {
     if (s.stmts.Count != 1)
     {
         return(null);
     }
     return(s.stmts[0] as IfStatement);
 }
Esempio n. 2
0
 public IfStatement(
     Exp test,
     SuiteStatement then,
     SuiteStatement orelse,
     string filename, int start, int end)
     : base(filename, start, end)
 {
     this.Test = test;
     this.Then = then;
     this.Else = orelse;
 }
 public void VisitSuite(SuiteStatement s)
 {
     foreach (var stm in s.stmts)
     {
         stm.Accept(this);
         if (!(stm is SuiteStatement))
         {
             w.WriteLine();
         }
     }
 }
Esempio n. 4
0
 public TryStatement(
     SuiteStatement body,
     List <ExceptHandler> exHandlers,
     Statement elseHandler,
     Statement finallyHandler,
     string filename,
     int start,
     int end)
     : base(filename, start, end)
 {
     this.body           = body;
     this.exHandlers     = exHandlers;
     this.elseHandler    = elseHandler;
     this.finallyHandler = finallyHandler;
 }
Esempio n. 5
0
 public ForStatement(
     Exp exprs,
     Exp tests,
     SuiteStatement body,
     SuiteStatement orelse,
     string filename,
     int start,
     int end)
     : base(filename, start, end)
 {
     this.exprs = exprs;
     this.tests = tests;
     this.Body  = body;
     this.Else  = orelse;
 }
Esempio n. 6
0
 public FunctionDef(
     Identifier name,
     List <Parameter> parameters,
     Identifier?vararg,
     Identifier?kwarg,
     Exp?annotation,
     SuiteStatement body, string filename, int start, int end)
     : base(filename, start, end)
 {
     this.name       = name;
     this.parameters = parameters;
     this.vararg     = vararg;
     this.kwarg      = kwarg;
     this.Annotation = annotation;
     this.body       = body;
 }
Esempio n. 7
0
 public WithStatement(List <WithItem> ws, SuiteStatement s, string filename, int pos, int end)
     : base(filename, pos, end)
 {
     this.items = ws;
     this.body  = s;
 }
Esempio n. 8
0
 public ExceptHandler(Exp?type, Identifier?name, SuiteStatement body, string filename, int start, int end) : base(filename, start, end)
 {
     this.type = type;
     this.name = name;
     this.body = body;
 }
Esempio n. 9
0
 public WhileStatement(Exp test, SuiteStatement body, SuiteStatement?els, string filename, int start, int end) : base(filename, start, end)
 {
     this.Test = test;
     this.Body = body;
     this.Else = els;
 }
Esempio n. 10
0
 public ClassDef(Identifier name, List <Exp> baseClasses, SuiteStatement body, string filename, int start, int end) : base(filename, start, end)
 {
     this.name = name;
     this.args = baseClasses;
     this.body = body;
 }
Esempio n. 11
0
 public Module(string moduleName, SuiteStatement body, string filename, int begin, int end) : base(filename, begin, end)
 {
     this.Name = moduleName;
     this.body = body;
 }