示例#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;
 }