gw.lang.parser.IParsedElement Maven / Gradle / Ivy
/*
* Copyright 2014 Guidewire Software, Inc.
*/
package gw.lang.parser;
import gw.lang.parser.exceptions.IWarningSuppressor;
import gw.lang.parser.resources.ResourceKey;
import gw.lang.reflect.IType;
import gw.lang.reflect.gs.IGosuClass;
import gw.lang.reflect.gs.IGosuProgram;
import gw.lang.reflect.module.IModule;
import java.util.List;
import java.util.Set;
import java.util.function.Consumer;
public interface IParsedElement
{
void addExceptionsFrom( IParsedElement elem );
IParseTree getLocation();
void setLocation( IParseTree location );
void visit( Consumer visitor );
boolean hasParseIssues();
List getParseIssues();
List getImmediateParseIssues();
IParseIssue getImmediateParseIssue( ResourceKey errKey );
boolean hasParseExceptions();
boolean hasParseException( ResourceKey errKey );
boolean hasImmediateParseIssue( ResourceKey errKey );
List getParseExceptions();
void addParseException( ResourceKey msgKey, Object... args );
void addParseException( IParseIssue e );
void addParseWarning( ResourceKey msgKey, Object... args );
void addParseWarning( IParseIssue warning );
boolean hasParseWarning( ResourceKey errKey );
void clearParseExceptions();
void clearParseWarnings();
boolean hasImmediateParseWarnings();
boolean hasParseWarnings();
List getParseWarnings();
boolean hasParseIssue( IParseIssue pi );
@SuppressWarnings("unchecked" )
boolean getContainedParsedElementsByType( Class parsedElementType, List listResults );
boolean getContainedParsedElementsByTypes( List listResults, Class extends IParsedElement>... parsedElementTypes );
boolean getContainedParsedElementsByTypesWithIgnoreSet( List listResults, Set> ignoreSet, Class extends IParsedElement>... parsedElementTypes );
IType getReturnType();
void clearParseTreeInformation();
IParsedElement getParent();
void setParent( IParsedElement rootElement );
int getLineNum();
int getColumn();
boolean isSynthetic();
String getFunctionName();
IModule getModule();
IParsedElement findRootParsedElement();
IParsedElement findAncestorParsedElementByType( Class... parsedElementClasses );
IParsedElementWithAtLeastOneDeclaration findDeclaringStatement( IParsedElement parsedElement, String identifierName );
List getTokens();
IGosuProgram getGosuProgram();
IGosuClass getGosuClass();
boolean isCompileTimeConstant();
boolean isSuppressed( IWarningSuppressor suppressor );
}