Exemple #1
0
		public void AddEnumDefinition(EnumDefinition enumDefinition)
		{
			if (this.enumDefinitions.ContainsKey(enumDefinition.Name))
			{
				throw new ParserException(enumDefinition.FirstToken, "An enum with this name has already been defined.");
			}

			this.VerifyNameFree(enumDefinition.NameToken);

			this.enumDefinitions.Add(enumDefinition.Name, enumDefinition);
		}
Exemple #2
0
 internal static int[] GetEnumValues(EnumDefinition enumDef)
 {
     return(enumDef.Items
            .Select <Token, int>(token => enumDef.IntValue[token.Value])
            .ToArray());
 }
Exemple #3
0
 public EnumValuesFunction(Token firstToken, EnumDefinition enumDef, TopLevelConstruct owner)
     : base(firstToken, owner)
 {
     this.enumDef = enumDef;
 }
Exemple #4
0
 public EnumValuesFunction(Token firstToken, EnumDefinition enumDef, Executable owner)
     : base(firstToken, owner)
 {
     this.enumDef = enumDef;
 }
Exemple #5
0
 public EnumReference(Token token, EnumDefinition enumDefinition, TopLevelConstruct owner)
     : base(token, owner)
 {
     this.EnumDefinition = enumDefinition;
 }
Exemple #6
0
 public EnumReference(Token token, EnumDefinition enumDefinition, Executable owner)
     : base(token, owner)
 {
     this.EnumDefinition = enumDefinition;
 }