Пример #1
0
 private IfStatement GetElif(SuiteStatement s)
 {
     if (s.stmts.Count != 1)
     {
         return(null);
     }
     return(s.stmts[0] as IfStatement);
 }
Пример #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;
 }
Пример #3
0
 public void VisitSuite(SuiteStatement s)
 {
     foreach (var stm in s.stmts)
     {
         stm.Accept(this);
         if (!(stm is SuiteStatement))
         {
             w.WriteLine();
         }
     }
 }
Пример #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;
 }
Пример #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;
 }
Пример #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;
 }
Пример #7
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;
 }
Пример #8
0
 public WithStatement(List <WithItem> ws, SuiteStatement s, string filename, int pos, int end)
     : base(filename, pos, end)
 {
     this.items = ws;
     this.body  = s;
 }
Пример #9
0
 public Module(string moduleName, SuiteStatement body, string filename, int begin, int end) : base(filename, begin, end)
 {
     this.Name = moduleName;
     this.body = body;
 }
Пример #10
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;
 }