4 changed files with 59 additions and 1 deletions
@ -0,0 +1,25 @@ |
|||||||
|
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||||
|
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||||
|
using System; |
||||||
|
using Irony; |
||||||
|
using Irony.Interpreter; |
||||||
|
using Irony.Interpreter.Evaluator; |
||||||
|
using Irony.Parsing; |
||||||
|
|
||||||
|
namespace ICSharpCode.Reporting.Expressions.Irony |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Description of ReportingLanguageGrammer.
|
||||||
|
/// </summary>
|
||||||
|
public class ReportingLanguageGrammer:ExpressionEvaluatorGrammar |
||||||
|
{ |
||||||
|
public ReportingLanguageGrammer() |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
public override LanguageRuntime CreateRuntime(LanguageData language) |
||||||
|
{ |
||||||
|
return new ReportingLanguageRuntime(language); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,29 @@ |
|||||||
|
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||||
|
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||||
|
using System; |
||||||
|
using Irony.Interpreter; |
||||||
|
using Irony.Parsing; |
||||||
|
|
||||||
|
namespace ICSharpCode.Reporting.Expressions.Irony |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Description of ReportingLanguageRuntime.
|
||||||
|
/// </summary>
|
||||||
|
public class ReportingLanguageRuntime:LanguageRuntime |
||||||
|
{ |
||||||
|
public ReportingLanguageRuntime(LanguageData language):base(language) |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
public override void Init() |
||||||
|
{ |
||||||
|
base.Init(); |
||||||
|
//add built-in methods, special form IIF, import Math and Environment methods
|
||||||
|
// BuiltIns.AddMethod(BuiltInPrintMethod, "print");
|
||||||
|
// BuiltIns.AddMethod(BuiltInFormatMethod, "format");
|
||||||
|
BuiltIns.AddSpecialForm(SpecialFormsLibrary.Iif, "iif", 3, 3); |
||||||
|
BuiltIns.ImportStaticMembers(typeof(System.Math)); |
||||||
|
BuiltIns.ImportStaticMembers(typeof(Environment)); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue