Пример #1
0
 public static SuperCallExpression ParseSuperCall(TokenStream stream, ClassDeclaration parent)
 {
     SuperCallExpression ret = new SuperCallExpression (stream.Location);
     stream.Expect (TokenClass.Keyword, "super");
     ret.Parent = parent;
     ret.Add (ParseArgumentList (stream));
     while (stream.Accept (TokenClass.SemiColon))
         ;
     return ret;
 }
Пример #2
0
		public override void Accept (SuperCallExpression super)
		{
			string[] subclass = super.Parent.Base [0].Split ('.');
			super.Arguments.Visit (this);
			methodBuilder.EmitInstruction (super.Location, Opcode.LoadGlobal,
				methodBuilder.Module.DefineConstant (new IodineName (subclass [0])));
			for (int i = 1; i < subclass.Length; i++) {
				methodBuilder.EmitInstruction (super.Location, Opcode.LoadAttribute,
					methodBuilder.Module.DefineConstant (new IodineName (subclass [0])));
			}
			methodBuilder.EmitInstruction (super.Location, Opcode.InvokeSuper,
				super.Arguments.Children.Count);
			for (int i = 1; i < super.Parent.Base.Count; i++) {
				string[] contract = super.Parent.Base [i].Split ('.');
				methodBuilder.EmitInstruction (super.Location, Opcode.LoadGlobal,
					methodBuilder.Module.DefineConstant (new IodineName (contract [0])));
				for (int j = 1; j < contract.Length; j++) {
					methodBuilder.EmitInstruction (super.Location, Opcode.LoadAttribute,
						methodBuilder.Module.DefineConstant (new IodineName (contract [0])));
				}
				methodBuilder.EmitInstruction (super.Location, Opcode.InvokeSuper, 0);
			}
		}
Пример #3
0
		public override void Accept (SuperCallExpression super)
		{
			errorLog.AddError (ErrorType.ParserError, super.Location,
				"statement can not exist inside pattern!");
		}
Пример #4
0
 public void Accept(SuperCallExpression super)
 {
 }
Пример #5
0
 public void Accept(SuperCallExpression super)
 {
     super.VisitChildren (this);
 }