Interface MacroDeclarations

All Known Implementing Classes:
IfElseMacro, InstancesHelper, JavaMacro, MacroDeclarationsCompositor, MathFunctions, NoMacros

public interface MacroDeclarations
Interface to expose macros to a program.

It is deliberately kept very simple to give as little constraints as possible to implementations.

There is an implied invariant here:
hasMacro(String) == true -> getMacro(String) != null

hasMacro(String) should be pure i.e. have no side effects.
Whereas getMacro(String) may have side effects.
(This is useful for creating macros on the fly in getMacro(String))
Version:
$Revision: 1000 $
Author:
Benjamin Weber ( benweber at student dot ethz dot ch )
  • Method Summary

    Modifier and Type
    Method
    Description
    Tries to fetch the macro
    boolean
    Whether the macro is declared
  • Method Details

    • hasMacro

      boolean hasMacro(String name)
      Whether the macro is declared
      Parameters:
      name - name of the macro being queried
      Returns:
      whether the macro is declared
    • getMacro

      Macro getMacro(String name)
      Tries to fetch the macro

      Before a macro is fetched it shold be checked whether it is declared through hasMacro(String)
      Parameters:
      name -
      Returns: