comparison graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/SLStatementNode.java @ 13821:b16ec83edc73

Documentation and more refactoring of Simple Language
author Christian Wimmer <christian.wimmer@oracle.com>
date Wed, 29 Jan 2014 20:45:43 -0800
parents 7c418666c6c9
children 111bf82514ca
comparison
equal deleted inserted replaced
13820:20e7727588e8 13821:b16ec83edc73
1 /* 1 /*
2 * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
20 * or visit www.oracle.com if you need additional information or have any 20 * or visit www.oracle.com if you need additional information or have any
21 * questions. 21 * questions.
22 */ 22 */
23 package com.oracle.truffle.sl.nodes; 23 package com.oracle.truffle.sl.nodes;
24 24
25 import com.oracle.truffle.api.dsl.*;
26 import com.oracle.truffle.api.frame.*; 25 import com.oracle.truffle.api.frame.*;
27 import com.oracle.truffle.api.nodes.*; 26 import com.oracle.truffle.api.nodes.*;
28 27
29 @TypeSystemReference(SLTypes.class) 28 /**
29 * The base class of all Truffle nodes for SL. All nodes (even expressions) can be used as
30 * statements, i.e., without returning a value. The {@link VirtualFrame} provides access to the
31 * local variables.
32 */
30 public abstract class SLStatementNode extends Node { 33 public abstract class SLStatementNode extends Node {
31 34
35 /**
36 * Execute this node as as statement, where no return value is necessary.
37 */
32 public abstract void executeVoid(VirtualFrame frame); 38 public abstract void executeVoid(VirtualFrame frame);
33
34 @Override
35 public String toString() {
36 return getEncapsulatingSourceSection() != null ? getEncapsulatingSourceSection().toString() : super.toString();
37 }
38 } 39 }