コード例 #1
0
 public object Visit(InterfaceMethodDeclaringNode n, object o)
 {
     _currentScopeLevel = 2;
     _currentClassST.EnterSymbol(n.Identifier.Value, n);
     _currentMethodST = new MethodSymbolTable(_currentClassST, n, _errorSummary);
     n.Parameters.Accept(this, null);
     _currentClassST.AddLocalMethodST(n.Identifier.Value, _currentMethodST);
     return(null);
 }
コード例 #2
0
ファイル: CodeGenerator.cs プロジェクト: tbyrresen/Deslang
 public object Visit(InterfaceMethodDeclaringNode n, object o)
 {
     _currentScopeLevel = 2;
     Append(AddIndent());
     n.Type.Accept(this, null);
     Append($" {n.Identifier.Value}(");
     n.Parameters.Accept(this, null);
     AppendLine($");");
     return(null);
 }
コード例 #3
0
        private DeclaringNode ParseInterfaceMethod()
        {
            DeclaringNode      itsAST;
            SourceCodePosition itsPos = _currentToken.SourcePosition;

            Accept(Token.TokenType.Method);
            TypeNode       itsType = ReturnType();
            IdentifierNode itsName = new IdentifierNode(_currentToken, itsType);

            Accept(Token.TokenType.Identifier);
            Accept(Token.TokenType.LeftParen);
            ParameterSequenceNode itsParams = Parameters();

            Accept(Token.TokenType.RightParen);
            Accept(Token.TokenType.Semicolon);
            itsAST = new InterfaceMethodDeclaringNode(itsName, itsType, itsParams, itsPos);
            return(itsAST);
        }