Search in sources :

Example 1 with HGSMap

use of de.neemann.digital.hdl.hgs.HGSMap in project Digital by hneemann.

the class ReferenceToStruct method set.

@Override
public void set(Context context, Object value) throws HGSEvalException {
    final HGSMap hgsMap = Value.toMap(parent.get(context));
    if (hgsMap.hgsMapGet(name) == null)
        throw new HGSEvalException("Value '" + name + "' not declared in struct!");
    hgsMap.hgsMapPut(name, value);
}
Also used : HGSMap(de.neemann.digital.hdl.hgs.HGSMap) HGSEvalException(de.neemann.digital.hdl.hgs.HGSEvalException)

Example 2 with HGSMap

use of de.neemann.digital.hdl.hgs.HGSMap in project Digital by hneemann.

the class ReferenceToStruct method declareVar.

@Override
public void declareVar(Context context, Object initial) throws HGSEvalException {
    final HGSMap hgsMap = Value.toMap(parent.get(context));
    if (hgsMap.hgsMapGet(name) != null)
        throw new HGSEvalException("Value '" + name + "' redeclared in struct!");
    hgsMap.hgsMapPut(name, initial);
}
Also used : HGSMap(de.neemann.digital.hdl.hgs.HGSMap) HGSEvalException(de.neemann.digital.hdl.hgs.HGSEvalException)

Aggregations

HGSEvalException (de.neemann.digital.hdl.hgs.HGSEvalException)2 HGSMap (de.neemann.digital.hdl.hgs.HGSMap)2