Interface IStringParserFactory<I extends VariableDeclaration>

  • Type Parameters:
    I - the variable declaration type
    All Known Implementing Classes:
    StringReplacerFactory, StringResolverFactory

    public interface IStringParserFactory<I extends VariableDeclaration>
    An optional factory turning in-place commands into language-specific expressions. If none is given, in-place commands shall not be resolved but shall remain as string expressions.
    Author:
    Holger Eichelberger
    • Method Detail

      • createIfExpression

        Expression createIfExpression​(InPlaceIfCommand<I> cmd)
                               throws VilException
        Creates an alternative expression.
        Parameters:
        cmd - the command to create an if-expression for
        Returns:
        an alternative expression (may be null if not supported)
        Throws:
        VilException - if the expression cannot be created
      • createForExpression

        Expression createForExpression​(InPlaceForCommand<I> cmd)
                                throws VilException
        Creates a for-loop expression.
        Parameters:
        cmd - the command to create a for-loop expression for
        Returns:
        a for-loop expression (may be null if not supported)
        Throws:
        VilException - if the expression cannot be created
      • createVarDeclExpression

        Expression createVarDeclExpression​(InPlaceVarDeclCommand<I> cmd)
                                    throws VilException
        Creates a variable declaration expression.
        Parameters:
        cmd - the command to create a variable declaration expression for
        Returns:
        a for-loop expression (may be null if not supported)
        Throws:
        VilException - if the expression cannot be created
      • createImportExpression

        Expression createImportExpression​(InPlaceImportCommand<I> cmd)
                                   throws VilException
        Creates an import expression.
        Parameters:
        cmd - the command to create an import expression for
        Returns:
        a for-loop expression (may be null if not supported)
        Throws:
        VilException - if the expression cannot be created
      • createVariable

        I createVariable​(java.lang.String name,
                         Expression initExpression,
                         boolean asIterator)
                  throws VilException
        Creates a variable.
        Parameters:
        name - the name of the variable
        initExpression - the initialization expression determining the type of the iterator variable
        asIterator - whether the variable shall act as iterator
        Returns:
        the variable
        Throws:
        VilException - if the variable cannot be created
      • createVariableDeclaration

        I createVariableDeclaration​(java.lang.String name,
                                    TypeDescriptor<?> type)
        Creates a non-constant variable declaration.
        Parameters:
        name - the name of the variable
        type - the type of the variable
        Returns:
        the variable declaration
      • createVersionRestriction

        IVersionRestriction createVersionRestriction​(Expression expression,
                                                     I variable)
                                              throws VilException
        Creates a version restriction from the given expression.
        Parameters:
        expression - the expression
        variable - the version variable
        Returns:
        the version restriction or null if not supported
        Throws:
        VilException - if the restriction cannot be created