Example #1
0
 /// <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);
 }
Example #2
0
 /// <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;
 }
Example #3
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <author>ALVES Quentin</author>
 public Token( )
 {
     this.Type = ETokenTypes.ETT_UNKNOW;
     this.Meta = null;
 }
Example #4
0
 /// <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;
 }
Example #5
0
 /// <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);
Example #6
0
 /// <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);
Example #7
0
 /// <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);
Example #8
0
        /// <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);
        }
Example #9
0
 /// <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);