Exemplo n.º 1
0
        public ITerminalWrapper GetValue(ElementBase key)
        {
            if (key is IResolvable) return GetValue(key as IResolvable);

            // fallback in case we've requested the value of a variable directly
            return GetValue((Identifier)key);
        }
Exemplo n.º 2
0
 public ITerminalWrapper GetValueOrNull(ElementBase key)
 {
     try
     {
         return GetValue(key);
     }
     catch (QLError)
     {
         return null;
     }
 }
Exemplo n.º 3
0
 public void Visit(ElementBase elementBase)
 {
     Exceptions.Add(new QLError(string.Format("Type checker was called for {0} but is not implemented", elementBase.GetType().Name)));
 }
Exemplo n.º 4
0
 /// <summary>
 /// This method has a signature with the highest class in the hierarchy and will act as a fallback
 /// </summary>
 public void Visit(ElementBase elementBase)
 {
     Debug.Assert(false, "GUI Visitor did not expect an ElementBase fallback");
 }
Exemplo n.º 5
0
 public void Visit(ElementBase node)
 {
     throw new QLError("Not implemented type to evaluate: " + node.GetType());
 }
Exemplo n.º 6
0
 public void Visit(ElementBase elementBase)
 {
     throw new QLError("Exporter attemted to export an ElementBase which is not allowed", elementBase.SourceLocation);
 }
Exemplo n.º 7
0
 public QLWarning(string message, ElementBase source)
     : base(message, source)
 {
 }
Exemplo n.º 8
0
 public QLBaseException(string message, ElementBase source)
     : base(message)
 {
     SourceLocation = source.SourceLocation;
 }
Exemplo n.º 9
0
 public QLError(string message, ElementBase source)
     : base(message, source)
 {
 }
Exemplo n.º 10
0
 public TypeCheckerError(string message, ElementBase source)
     : base(message)
 {
     SourceLocation = source.SourceLocation;
 }
Exemplo n.º 11
0
 private void AppendToAST(ElementBase newChild)
 {
     if (_childrenStack.Any())
     {
         Queue<ElementBase> siblings = _childrenStack.Peek();
         siblings.Enqueue(newChild);
     }
     else
     {
         //this is the last one, it should be Form
         _astRootNode = (Form)newChild;
     }
 }