Axiom.Scripting.Compiler.ScriptCompiler.AddError C# (CSharp) Method

AddError() private method

private AddError ( CompileErrorCode code, string file, uint line ) : void
code CompileErrorCode
file string
line uint
return void
		internal void AddError( CompileErrorCode code, string file, uint line )
		{
			this.AddError( code, file, line, string.Empty );
		}

Same methods

ScriptCompiler::AddError ( CompileErrorCode code, string file, uint line, string msg ) : void

Usage Example

			/// <see cref="Translator.Translate"/>
			public override void Translate( ScriptCompiler compiler, AbstractNode node )
			{
				var obj = (ObjectAbstractNode)node;

				// Must have a type as the first value
				if ( obj.Values.Count == 0 )
				{
					compiler.AddError( CompileErrorCode.StringExpected, obj.File, obj.Line );
					return;
				}

				var type = string.Empty;
				if ( !getString( obj.Values[ 0 ], out type ) )
				{
					compiler.AddError( CompileErrorCode.InvalidParameters, obj.File, obj.Line );
					return;
				}

				var system = (ParticleSystem)obj.Parent.Context;
				this._Emitter = system.AddEmitter( type );

				foreach ( var i in obj.Children )
				{
					if ( i is PropertyAbstractNode )
					{
						var prop = (PropertyAbstractNode)i;
						var value = string.Empty;

						// Glob the values together
						foreach ( var it in prop.Values )
						{
							if ( it is AtomAbstractNode )
							{
								if ( string.IsNullOrEmpty( value ) )
								{
									value = ( (AtomAbstractNode)it ).Value;
								}
								else
								{
									value = value + " " + ( (AtomAbstractNode)it ).Value;
								}
							}
							else
							{
								compiler.AddError( CompileErrorCode.InvalidParameters, prop.File, prop.Line );
								break;
							}
						}

						if ( !this._Emitter.SetParam( prop.Name, value ) )
						{
							compiler.AddError( CompileErrorCode.InvalidParameters, prop.File, prop.Line );
						}
					}
					else
					{
						processNode( compiler, i );
					}
				}
			}
All Usage Examples Of Axiom.Scripting.Compiler.ScriptCompiler::AddError