コード例 #1
0
        /// <summary>
        /// This method prints the apinNode
        /// </summary>
        /// <param name="apinNode">The node to print.</param>
        /// <returns>Returns null</returns>
        public override object Visit(APinNode apinNode)
        {
            Print("APinNode");

            return(null);
        }
コード例 #2
0
 /// <summary>
 /// This method visits an Apin node
 /// It checks if the analog pin is defined or is a part of an expression
 /// If its a part of an expression it prints the Apin and the ID
 /// </summary>
 /// <param name="apinNode">The name of the node</param>
 /// <returns>Returns the Apin ID or "AnalogueRead(Apin and ID)"</returns>
 public override object Visit(APinNode apinNode)
 {
     return(apinNode.Parent == null ? apinNode.Id : $"analogueRead({apinNode.Id})");
 }
コード例 #3
0
ファイル: TypeChecker.cs プロジェクト: smh87/PseudoIno-lang
 /// <summary>
 /// This method type checks the APinNode node in the AST.
 /// </summary>
 /// <param name="apinNode">The node to check.</param>
 /// <returns>APin type context</returns>
 public override object Visit(APinNode apinNode)
 {
     return(new TypeContext(NUMERIC));
 }
コード例 #4
0
ファイル: Visitor.cs プロジェクト: smh87/PseudoIno-lang
 /// <summary>
 /// This visits an APin node
 /// </summary>
 /// <param name="apinNode">The visited node</param>
 /// <returns></returns>
 public abstract object Visit(APinNode apinNode);