/**
 * Derived class that represents a comment in the SILLY language.
 *   @author Dave Reed
 *   @version 2/8/17
 */
public class Comment extends Statement {
    private String line;

    /**
     * Reads in an output statement from the specified TokenStream.
     *   @param input the stream to be read from
     */
    public Comment(TokenStream input) throws Exception {
        if (!input.next().toString().equals("//")) {
            throw new Exception("SYNTAX ERROR: Malformed comment");
        }
        this.line = input.nextLine();
    }

    /**
     * Executes the current output statement.
     */
    public void execute() throws Exception {
        // does nothing
    }

    /**
     * Converts the current output statement into a String.
     *   @return the String representation of this statement
     */
    public String toString() {
        return "//" + this.line;
    }
}
