/// <summary> /// Constructor /// </summary> /// <author>ALVES Quentin</author> /// <param name="type" >Type of the new token</param> /// <param name="line" >Line of the new token from file start</param> /// <param name="position" >Position of the token from current line start</param> /// <param name="text" >Text that represent the token on the source text</param> public Token(ETokenTypes type, int line, int position, string text) { this.Type = type; this.Meta = new Textmeta(line, position, text); }
/// <summary> /// Constructor /// </summary> /// <author>ALVES Quentin</author> /// <param name="type" >Type of diagnostic</param> /// <param name="message" >Message of the diagnostic</param> /// <param name="meta" >Metadata of the diagnostic</param> public Diagnostic(EDiagnosticTypes type, string message, Textmeta meta) { this.Type = type; this.Message = message; this.Meta = meta; }
/// <summary> /// Constructor /// </summary> /// <author>ALVES Quentin</author> public Token( ) { this.Type = ETokenTypes.ETT_UNKNOW; this.Meta = null; }
/// <summary> /// Constructor /// </summary> /// <author>ALVES Quentin</author> /// <param name="line" >Line ID of the end of file token</param> public Token(int line) { this.Type = ETokenTypes.ETT_EOF; this.Meta = null; }
/// <summary> /// EmitErrr method /// </summary> /// <author>ALVES Quentin</author> /// <note>Add an error line to the report</note> /// <param name="message" >Message of the diagnostic</param> /// <param name="meta" >Metadata of the diagnostic</param> public void EmitErrr(string message, Textmeta meta) => this.Emit(EDiagnosticTypes.EDT_ERRR, message, meta);
/// <summary> /// EmitWarn method /// </summary> /// <author>ALVES Quentin</author> /// <note>Add a warning line to the report</note> /// <param name="message" >Message of the diagnostic</param> /// <param name="meta" >Metadata of the diagnostic</param> public void EmitWarn(string message, Textmeta meta) => this.Emit(EDiagnosticTypes.EDT_WARN, message, meta);
/// <summary> /// EmitInfo method /// </summary> /// <author>ALVES Quentin</author> /// <note>Add an info line to the report</note> /// <param name="message" >Message of the diagnostic</param> /// <param name="meta" >Metadata of the diagnostic</param> public void EmitInfo(string message, Textmeta meta) => this.Emit(EDiagnosticTypes.EDT_INFO, message, meta);
/// <summary> /// Emit method /// </summary> /// <author>ALVES Quentin</author> /// <note>Add a line to the report</note> /// <param name="type" >Type of diagnostic</param> /// <param name="message" >Message of the diagnostic</param> /// <param name="meta" >Metadata of the diagnostic</param> private void Emit(EDiagnosticTypes type, string message, Textmeta meta) { var diag = new Diagnostic(type, message, meta); this.diags.Add(diag); }
/// <EmitErrr> /// EmitInfo method /// </summary> /// <author>ALVES Quentin</author> /// <note>Emit an error diagnotic</note> /// <param name="message" >Message of the diagnostic</param> /// <param name="meta" >Metadata of the diagnostic</param> public void EmitErrr(string message, Textmeta meta) => this.Report.EmitErrr(message, meta);