/******************************************************************************* * Copyright (c) 2009-2015 CWI * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * * Jurgen J. Vinju - Jurgen.Vinju@cwi.nl - CWI * * Tijs van der Storm - Tijs.van.der.Storm@cwi.nl * * Paul Klint - Paul.Klint@cwi.nl - CWI * * Mark Hills - Mark.Hills@cwi.nl (CWI) * * Arnold Lankamp - Arnold.Lankamp@cwi.nl * * Michael Steindorfer - Michael.Steindorfer@cwi.nl - CWI *******************************************************************************/ package org.rascalmpl.ast; import org.rascalmpl.value.IConstructor; import org.rascalmpl.value.ISourceLocation; public abstract class Start extends AbstractAST { public Start(ISourceLocation src, IConstructor node) { super(src /* we forget node on purpose */); } public boolean isAbsent() { return false; } static public class Absent extends Start { // Production: sig("Absent",[],breakable=false) public Absent(ISourceLocation src, IConstructor node ) { super(src, node); } @Override public boolean isAbsent() { return true; } @Override public <T> T accept(IASTVisitor<T> visitor) { return visitor.visitStartAbsent(this); } @Override protected void addForLineNumber(int $line, java.util.List<AbstractAST> $result) { if (getLocation().getBeginLine() == $line) { $result.add(this); } ISourceLocation $l; } @Override public boolean equals(Object o) { if (!(o instanceof Absent)) { return false; } Absent tmp = (Absent) o; return true ; } @Override public int hashCode() { return 127 ; } @Override public Object clone() { return newInstance(getClass(), src, (IConstructor) null ); } } public boolean isPresent() { return false; } static public class Present extends Start { // Production: sig("Present",[],breakable=false) public Present(ISourceLocation src, IConstructor node ) { super(src, node); } @Override public boolean isPresent() { return true; } @Override public <T> T accept(IASTVisitor<T> visitor) { return visitor.visitStartPresent(this); } @Override protected void addForLineNumber(int $line, java.util.List<AbstractAST> $result) { if (getLocation().getBeginLine() == $line) { $result.add(this); } ISourceLocation $l; } @Override public boolean equals(Object o) { if (!(o instanceof Present)) { return false; } Present tmp = (Present) o; return true ; } @Override public int hashCode() { return 823 ; } @Override public Object clone() { return newInstance(getClass(), src, (IConstructor) null ); } } }