. operator as lvalue

This commit is contained in:
gnembon committed 2019-10-11 11:11:54 -03:00
1 parent 985b179cb2
commit a84b06306a
5 files changed
+67 -27

No files matched your search

@@ -0,0 +1,30 @@
package carpet.script.value;
import carpet.script.exception.ExpressionException;
public abstract class FrameworkValue extends Value
{
@Override
public String getString()
{
throw new ExpressionException("Scarpet language component cannot be used");
}
@Override
public boolean getBoolean()
{
throw new ExpressionException("Scarpet language component cannot be used");
}
@Override
public Value clone()
{
throw new ExpressionException("Scarpet language component cannot be used");
}
@Override
public int hashCode()
{
throw new UnsupportedOperationException("Scarpet language component cannot be used as map key");
}
}
@@ -4,29 +4,13 @@ import carpet.script.exception.ExpressionException;
import java.util.List;
public class FunctionSignatureValue extends Value
public class FunctionSignatureValue extends FrameworkValue
{
private String identifier;
private List<String> arguments;
private List<String> globals;
@Override
public String getString()
{
throw new ExpressionException("Function "+identifier+" is not defined yet");
}
@Override
public boolean getBoolean()
{
throw new ExpressionException("Function "+identifier+" is not defined yet");
}
@Override
public Value clone()
{
throw new ExpressionException("Function "+identifier+" is not defined yet");
}
public FunctionSignatureValue(String name, List<String> args, List<String> globals)
{
this.identifier = name;
@@ -43,11 +27,7 @@ public class FunctionSignatureValue extends Value
}
public List<String> getGlobals() {return globals;}
@Override
public int hashCode()
{
throw new UnsupportedOperationException("function signature value cannot be used as map key");
}
}
@@ -0,0 +1,16 @@
package carpet.script.value;
public class LContainerValue extends FrameworkValue
{
private ContainerValueInterface container;
private Value address;
public LContainerValue(ContainerValueInterface c, Value v)
{
container = c;
address = v;
}
public ContainerValueInterface getContainer() {return container; }
public Value getAddress() {return address; }
}