All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gw.lang.parser.IParsedElement Maven / Gradle / Ivy

There is a newer version: 1.18.2
Show newest version
/*
 * 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... parsedElementTypes );

  boolean getContainedParsedElementsByTypesWithIgnoreSet( List listResults, Set> ignoreSet, Class... 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 );
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy