public void FromClassEntry(CommonClassEntry entry) { this.Name = entry.Name; this.Type = entry.Type; this.Scope = entry.Scope; this.DeclarationPosition = entry.DeclarationPosition; }
CommonClassEntry readCommonClassEntry(TokenStream gStream) { CommonClassEntry entry = new CommonClassEntry(); entry.Scope = readScope(gStream); entry.DeclarationPosition = gStream.SourcePosition; entry.Modifiers = readModifiers(gStream); entry.Type = gStream.NextType(true); entry.Name = gStream.GetIdentifierNext(); return(entry); }
Field parseField(CommonClassEntry entry, TokenStream gStream) { Field field = new Field(); if (gStream.Is(";") && entry.Modifiers.HasFlag(ClassEntryModifiers.Const)) { InfoProvider.AddError("Const field must be initialized immediately", ExceptionType.UninitedConstant, gStream.SourcePosition); } field.FromClassEntry(entry); if (gStream.Is("=")) { gStream.Next(); field.InitialExpressionPosition = gStream.TokenPosition; gStream.SkipTo(";", true); } return(field); }
Method parseMethod(CommonClassEntry entry, TokenStream gStream) { Method method = new Method(); method.FromClassEntry(entry); ParameterList paramList = readParams(gStream); if (gStream.Next() == "->") { method.Begin = gStream.TokenPosition; } else if (gStream.Current == "{") { method.Begin = gStream.TokenPosition - 1; gStream.SkipBraced('{', '}'); } }