Class SimpleVariableDeclarations

    • Constructor Detail

      • SimpleVariableDeclarations

        public SimpleVariableDeclarations()
    • Method Detail

      • hasVariable

        public boolean hasVariable​(String name)
        Whether the variable is declared
        Specified by:
        hasVariable in interface VariableDeclarations
        Parameters:
        name - name of the variable being queried
        Returns:
        whether the variable is declared
      • getVariable

        public Node getVariable​(String name)
        Tries to fetch a declared variable
        Specified by:
        getVariable in interface VariableDeclarations
        Parameters:
        name - name of the variable to be fetched
        Returns:
        an AST (abstrac syntax tree) node representing the variable
      • addBoolean

        public void addBoolean​(String name)
        Adds a variable declaration for a boolean variable

        Requires that the variable hasn't been declared before.
        Parameters:
        name - the name of the variable
      • addDouble

        public void addDouble​(String name)
        Adds a variable declaration for a double variable

        Requires that the variable hasn't been declared before.
        Parameters:
        name - the name of the variable
      • addString

        public void addString​(String name)
        Adds a variable declaration for a string variable

        Requires that the variable hasn't been declared before.
        Parameters:
        name - the name of the variable