public static void CheckStaticFieldDef(RangeFinderState s, StaticFieldDef a) { CheckAny(s, a.Name); CheckAny(s, a.Type); CheckList(s, a.Attributes); CheckAny(s, a.InitializerExpr); }
public static void PrintStaticFieldDef(PrintState s, StaticFieldDef a) { PrintDescWithToken(s, "StaticFieldDef", a.Name); Indent(s); PrintDescWithAny(s, "Type", a.Type); UnIndent(s); }
public static StaticFieldDef ParseEnumMemberTail(ParserState s, Token name, NamespaceDef parent) { var def = new StaticFieldDef { Name = name, IsEnumOption = true, Parent = parent }; if (s.Token.Type == TokenType.Operator && s.Token.Value == "=") { ReadToken(s); def.InitializerExpr = ParseExpression(s, 0, true); } return(def); }
public static StaticFieldDef ParseStaticField(ParserState s, NamespaceDef parent) { ParseTokenWithType(s, TokenType.Colon); var id = ParseTokenWithType(s, TokenType.Identifier); var def = new StaticFieldDef { Name = id, Parent = parent }; if (s.Token.Type == TokenType.Identifier || (s.Token.Type == TokenType.Operator && (s.Token.Value == "*" || s.Token.Value == "$" || s.Token.Value == "::"))) { def.Type = ParseType(s); } def.Attributes = TryParseAttributes(s); if (s.Token.Type == TokenType.Operator && s.Token.Value == "=") { ReadToken(s); def.InitializerExpr = ParseExpression(s, 0, true); } return(def); }