Package org.apache.sysds.parser

# Class DMLProgram

java.lang.Object
org.apache.sysds.parser.DMLProgram

public class DMLProgram extends Object

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`BUILTIN_NAMESPACE`
`static final String`
`DEFAULT_NAMESPACE`
`static final String`
`INTERNAL_NAMESPACE`

## Constructor Summary

Constructors
Constructor
Description
`DMLProgram()`
`DMLProgram(String namespace)`

## Method Summary

Modifier and Type
Method
Description
`void`
`addFunctionStatementBlock(String namespace, String fname, FunctionStatementBlock fsb)`
`void`
`addFunctionStatementBlock(String fname, FunctionStatementBlock fsb)`
`void`
`addStatementBlock(StatementBlock b)`
`static String`
`constructFunctionKey(String fnamespace, String fname)`
`boolean`
`containsRemoteParfor()`
`void`
`copyOriginalFunctions()`
`FunctionDictionary<FunctionStatementBlock>`
`createNamespace(String namespace)`
`FunctionDictionary<FunctionStatementBlock>`
`getBuiltinFunctionDictionary()`
`FunctionDictionary<FunctionStatementBlock>`
`getDefaultFunctionDictionary()`
`FunctionDictionary<FunctionStatementBlock>`
`getFunctionDictionary(String namespace)`
`FunctionStatementBlock`
`getFunctionStatementBlock(String fkey)`
`FunctionStatementBlock`
`getFunctionStatementBlock(String namespaceKey, String functionName)`
`List<FunctionStatementBlock>`
`getFunctionStatementBlocks()`
`Map<String,FunctionStatementBlock>`
`getFunctionStatementBlocks(String namespaceKey)`
`Map<String,FunctionStatementBlock>`
`getNamedNSFunctionStatementBlocks()`
`Map<String,FunctionDictionary<FunctionStatementBlock>>`
`getNamespaces()`
`int`
`getNumStatementBlocks()`
`StatementBlock`
`getStatementBlock(int i)`
`ArrayList<StatementBlock>`
`getStatementBlocks()`
`boolean`
`hasFunctionStatementBlocks()`
`void`
`hoistFunctionCallsFromExpressions()`
`static boolean`
`isInternalNamespace(String namespace)`
`void`
`mergeStatementBlocks()`
`void`
`removeFunctionStatementBlock(String fkey)`
`void`
`removeFunctionStatementBlock(String namespaceKey, String functionName)`
`void`
`setContainsRemoteParfor(boolean flag)`
`void`
`setStatementBlocks(ArrayList<StatementBlock> passed)`
`static String[]`
`splitFunctionKey(String fkey)`
`String`
`toString()`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### DEFAULT_NAMESPACE

public static final String DEFAULT_NAMESPACE

See Also:
  - Constant Field Values

### BUILTIN_NAMESPACE

public static final String BUILTIN_NAMESPACE

See Also:
  - Constant Field Values

### INTERNAL_NAMESPACE

public static final String INTERNAL_NAMESPACE

See Also:
  - Constant Field Values

## Constructor Details

### DMLProgram

public DMLProgram()

### DMLProgram

public DMLProgram(String namespace)

## Method Details

### getNamespaces

public Map<String,FunctionDictionary<FunctionStatementBlock>> getNamespaces()

### addStatementBlock

public void addStatementBlock(StatementBlock b)

### getNumStatementBlocks

public int getNumStatementBlocks()

### setContainsRemoteParfor

public void setContainsRemoteParfor(boolean flag)

### containsRemoteParfor

public boolean containsRemoteParfor()

### isInternalNamespace

public static boolean isInternalNamespace(String namespace)

### createNamespace

public FunctionDictionary<FunctionStatementBlock> createNamespace(String namespace)

### getFunctionStatementBlock

public FunctionStatementBlock getFunctionStatementBlock(String fkey)

Parameters:
  `fkey` - function key as concatenation of namespace and function name (see DMLProgram.constructFunctionKey)
Returns:
  function statement block

### removeFunctionStatementBlock

public void removeFunctionStatementBlock(String fkey)

### getFunctionStatementBlock

public FunctionStatementBlock getFunctionStatementBlock(String namespaceKey, String functionName)

### removeFunctionStatementBlock

public void removeFunctionStatementBlock(String namespaceKey, String functionName)

### getFunctionStatementBlocks

public Map<String,FunctionStatementBlock> getFunctionStatementBlocks(String namespaceKey)

### hasFunctionStatementBlocks

public boolean hasFunctionStatementBlocks()

### getFunctionStatementBlocks

public List<FunctionStatementBlock> getFunctionStatementBlocks()

### getNamedNSFunctionStatementBlocks

public Map<String,FunctionStatementBlock> getNamedNSFunctionStatementBlocks()

### getDefaultFunctionDictionary

public FunctionDictionary<FunctionStatementBlock> getDefaultFunctionDictionary()

### getBuiltinFunctionDictionary

public FunctionDictionary<FunctionStatementBlock> getBuiltinFunctionDictionary()

### getFunctionDictionary

public FunctionDictionary<FunctionStatementBlock> getFunctionDictionary(String namespace)

### addFunctionStatementBlock

public void addFunctionStatementBlock(String fname, FunctionStatementBlock fsb)

### addFunctionStatementBlock

public void addFunctionStatementBlock(String namespace, String fname, FunctionStatementBlock fsb)

### copyOriginalFunctions

public void copyOriginalFunctions()

### getStatementBlocks

public ArrayList<StatementBlock> getStatementBlocks()

### setStatementBlocks

public void setStatementBlocks(ArrayList<StatementBlock> passed)

### getStatementBlock

public StatementBlock getStatementBlock(int i)

### mergeStatementBlocks

public void mergeStatementBlocks()

### hoistFunctionCallsFromExpressions

public void hoistFunctionCallsFromExpressions()

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### constructFunctionKey

public static String constructFunctionKey(String fnamespace, String fname)

### splitFunctionKey

public static String[] splitFunctionKey(String fkey)