コード例 #1
0
 // ArrayType of base T and given rank
 public ArrayTypeSig(NonRefTypeSig tElem, int dimension)
 {
     Debug.Assert(tElem != null);
     
     m_filerange = tElem.Location;
     m_cDimension = dimension;
     m_sigBase = tElem;
 }
コード例 #2
0
ファイル: AST.cs プロジェクト: chenzuo/blue
 public ParamVarDecl(Identifier idName, NonRefTypeSig tType, EArgFlow eFlow) : base(idName, tType)
 {
     m_eFlow = eFlow;
     
     // Update tType to include the Ref/Out
     if (m_eFlow == EArgFlow.cOut || m_eFlow == EArgFlow.cRef)
     {
         this.m_tType = new RefTypeSig(tType);
     }
     
     m_symbol = new ParamVarExpEntry();
 }
コード例 #3
0
ファイル: AST.cs プロジェクト: chenzuo/blue
 public EventDecl(
     Identifier idName,
     NonRefTypeSig tType,
     Modifiers mods
 )
 {
     Debug.Assert(idName != null);
     Debug.Assert(tType != null);
     
     m_idName    = idName;
     m_tType     = tType;
     m_mods      = mods;    
 }              
コード例 #4
0
ファイル: Parser.cs プロジェクト: chenzuo/blue
//-----------------------------------------------------------------------------
// Helper to parse array decls.
// For arrays, leftmost [] is the outermost
// So X[][,,][,] is 1d of 3d of 2d of X
// Because this is left to right (and not right to left), we have to be
// stack based / recursive (instead of an iterative while)
// 
// sigElemType is the type of the non-array portion (X in the above example)
// Note that if this isn't an array type, we'll just return sigElemType
//-----------------------------------------------------------------------------
    NonRefTypeSig ParseOptionalArrayDecl(NonRefTypeSig sigElemType)
    {
        Token t = m_lexer.PeekNextToken();
        
        if (t.TokenType == Token.Type.cLRSquare)
        {
            ConsumeNextToken();
            
            int dim = t.Dimension;
            NonRefTypeSig sig = ParseOptionalArrayDecl(sigElemType);
            sig = new ArrayTypeSig(sig, dim);
            
            string stTest = sig.ToString();
            
            return sig;
            
        } else {
            return sigElemType;
        }
    }
コード例 #5
0
 // Create around an existing type
 public RefTypeSig(NonRefTypeSig sig)        
 {
     Debug.Assert(sig != null);
     m_tElem = sig;
 }