Class DlgpeElemFactory

java.lang.Object
fr.inria.rules.integraal.io.dlgpe2.DlgpeElemFactory
All Implemented Interfaces:
fr.inria.rules.dlgpereader.builder.api.IElemFactory

public class DlgpeElemFactory extends Object implements fr.inria.rules.dlgpereader.builder.api.IElemFactory
Creates InteGraal elements while parsing DLGPE input.
  • Constructor Details

    • DlgpeElemFactory

      public DlgpeElemFactory(IntegraalEnvironment env)
      Creates an element factory bound to the supplied parsing environment.
      Parameters:
      env - the DLGPE parsing environment
  • Method Details

    • getTermFactory

      public SameObjectTermFactory getTermFactory()
      Returns the term factory used by this element factory.
      Returns:
      the backing term factory
    • createConstant

      public Constant createConstant(String name)
      Specified by:
      createConstant in interface fr.inria.rules.dlgpereader.builder.api.IElemFactory
    • createVariable

      public Variable createVariable(String name, boolean anonymous)
      Specified by:
      createVariable in interface fr.inria.rules.dlgpereader.builder.api.IElemFactory
    • createLiteral

      public fr.inria.rules.dlgpemodel.api.elems.ILiteral createLiteral(String repr, String type)
      Specified by:
      createLiteral in interface fr.inria.rules.dlgpereader.builder.api.IElemFactory
    • createFunctionalTerm

      public EvaluableFunction createFunctionalTerm(String functionName, List<? extends fr.inria.rules.dlgpemodel.api.elems.ITerm> args)
      Specified by:
      createFunctionalTerm in interface fr.inria.rules.dlgpereader.builder.api.IElemFactory
    • readJsonArrayFromUrl

      public static org.json.JSONArray readJsonArrayFromUrl(String url) throws Exception
      Reads a JSON array from the supplied URL.
      Parameters:
      url - the URL to fetch
      Returns:
      the parsed JSON array
      Throws:
      Exception - if the content cannot be fetched or parsed
    • createPredicate

      public Predicate createPredicate(String name, int arity)
      Specified by:
      createPredicate in interface fr.inria.rules.dlgpereader.builder.api.IElemFactory