Skip to content

Commit 71ef988

Browse files
committed
Version 1.0.0.0
1 parent a3e3a70 commit 71ef988

13 files changed

Lines changed: 20817 additions & 0 deletions
218 KB
Binary file not shown.

MathCompiler/CodedInfo.cs

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
// MathCompiler - Mathematical function compiler for calculation of function
2+
// values of arbitrary complex single-line mathematical formulas
3+
// Copyright (C) 2018 Achim Zielesny (achim.zielesny@googlemail.com)
4+
//
5+
// Source code is available at <https://github.com/zielesny/MathCompiler>
6+
//
7+
// This program is free software: you can redistribute it and/or modify
8+
// it under the terms of the GNU General Public License as published by
9+
// the Free Software Foundation, either version 3 of the License, or
10+
// (at your option) any later version.
11+
//
12+
// This program is distributed in the hope that it will be useful,
13+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
// GNU General Public License for more details.
16+
//
17+
// You should have received a copy of the GNU General Public License
18+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
20+
using System;
21+
using System.Collections.Generic;
22+
using System.Text;
23+
24+
namespace MathCompiler
25+
{
26+
/// <summary>
27+
/// Coded information for classes MathCompiler
28+
/// </summary>
29+
public enum CodedInfo : int
30+
{
31+
/// <summary>
32+
/// Formula contains forbidden character.
33+
/// </summary>
34+
ForbiddenCharacter = 0,
35+
/// <summary>
36+
/// First token ' {0} ' is invalid.
37+
/// </summary>
38+
InvalidFirstToken = 1,
39+
/// <summary>
40+
/// Token ' {1} ' is not allowed to follow token ' {0} '.
41+
/// </summary>
42+
InvalidFollowToken = 2,
43+
/// <summary>
44+
/// Function ' {0} ' has {1} argument(s).
45+
/// </summary>
46+
InvalidFunctionArgumentCount = 3,
47+
/// <summary>
48+
/// Last token ' {0} ' is invalid.
49+
/// </summary>
50+
InvalidLastToken = 4,
51+
/// <summary>
52+
/// Invalid token: ' {0} '.
53+
/// </summary>
54+
InvalidToken = 5,
55+
/// <summary>
56+
/// Vector expression ' {0} ' is only allowed as an argument of a vector function.
57+
/// </summary>
58+
InvalidVectorExpression = 6,
59+
/// <summary>
60+
/// Closing bracket is missing.
61+
/// </summary>
62+
MissingClosingBracket = 7,
63+
/// <summary>
64+
/// Function ' {0} ' does not have a closing bracket.
65+
/// </summary>
66+
MissingFunctionClosingBracket = 8,
67+
/// <summary>
68+
/// No Formula defined.
69+
/// </summary>
70+
NoFormula = 9,
71+
/// <summary>
72+
/// Formula is null/empty.
73+
/// </summary>
74+
FormulaNullEmpty = 10,
75+
/// <summary>
76+
/// Formula is successfully compiled.
77+
/// </summary>
78+
SuccessfullyCompiled = 11,
79+
/// <summary>
80+
/// Unequal number of brackets: Open/Close = {0} / {1}.
81+
/// </summary>
82+
UnequalNumberOfBrackets = 12,
83+
/// <summary>
84+
/// Argument {0} of vector function ' {1} ' is a vector argument.
85+
/// </summary>
86+
MissingVectorArgument = 13,
87+
/// <summary>
88+
/// Argument {0} of vector function ' {1} ' is a scalar argument.
89+
/// </summary>
90+
MissingScalarArgument = 14,
91+
/// <summary>
92+
/// Not used
93+
/// </summary>
94+
NotUsed1 = 15,
95+
/// <summary>
96+
/// Invalid repeating quotation marks.
97+
/// </summary>
98+
InvalidRepeatingQuotationMarks = 16,
99+
/// <summary>
100+
/// Not used
101+
/// </summary>
102+
NotUsed2 = 17,
103+
/// <summary>
104+
/// Conditional IF has 3 arguments.
105+
/// </summary>
106+
InvalidIfArgumentCount = 18,
107+
/// <summary>
108+
/// Conditional IF does not have a closing bracket.
109+
/// </summary>
110+
MissingIfClosingBracket = 19,
111+
/// <summary>
112+
/// Invalid token outside multi-parameter function: ' {0} '.
113+
/// </summary>
114+
InvalidTokenOutsideFormula = 20,
115+
/// <summary>
116+
/// Not used
117+
/// </summary>
118+
NotUsed3 = 21,
119+
/// <summary>
120+
/// Not used
121+
/// </summary>
122+
NotUsed4 = 22,
123+
/// <summary>
124+
/// Not used
125+
/// </summary>
126+
NotUsed5 = 23,
127+
/// <summary>
128+
/// Not used
129+
/// </summary>
130+
NotUsed6 = 24,
131+
/// <summary>
132+
/// Not used
133+
/// </summary>
134+
NotUsed7 = 25,
135+
/// <summary>
136+
/// Not used
137+
/// </summary>
138+
NotUsed8 = 26,
139+
/// <summary>
140+
/// Invalid vector: Curly closing bracket is missing.
141+
/// </summary>
142+
InvalidVector = 27,
143+
/// <summary>
144+
/// Unequal number of curly brackets: Open/Close = {0} / {1}.
145+
/// </summary>
146+
UnequalNumberOfCurlyBrackets = 28,
147+
/// <summary>
148+
/// Illegal custom item.
149+
/// </summary>
150+
IllegalCustomItem = 29,
151+
/// <summary>
152+
/// Custom items successfully set.
153+
/// </summary>
154+
CustomItemsSuccessfullySet = 30,
155+
/// <summary>
156+
/// Illegal nested vector.
157+
/// </summary>
158+
IllegalNestedVector = 31
159+
}
160+
}

MathCompiler/CodedInfoItem.cs

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
// MathCompiler - Mathematical function compiler for calculation of function
2+
// values of arbitrary complex single-line mathematical formulas
3+
// Copyright (C) 2018 Achim Zielesny (achim.zielesny@googlemail.com)
4+
//
5+
// Source code is available at <https://github.com/zielesny/MathCompiler>
6+
//
7+
// This program is free software: you can redistribute it and/or modify
8+
// it under the terms of the GNU General Public License as published by
9+
// the Free Software Foundation, either version 3 of the License, or
10+
// (at your option) any later version.
11+
//
12+
// This program is distributed in the hope that it will be useful,
13+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
// GNU General Public License for more details.
16+
//
17+
// You should have received a copy of the GNU General Public License
18+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
20+
using System;
21+
using System.Collections.Generic;
22+
using System.Text;
23+
24+
namespace MathCompiler
25+
{
26+
/// <summary>
27+
/// Coded information item
28+
/// </summary>
29+
public class CodedInfoItem
30+
{
31+
32+
#region Private class variables
33+
34+
/// <summary>
35+
/// Coded information
36+
/// </summary>
37+
private CodedInfo myCodedInfo;
38+
/// <summary>
39+
/// Coded information arguments
40+
/// </summary>
41+
private String[] myCodedInfoArguments;
42+
43+
#endregion
44+
45+
////////////////////////////////////////////////////////////////////////////////
46+
47+
#region Constructor
48+
49+
/// <summary>
50+
/// Constructor
51+
/// </summary>
52+
/// <param name="codedInfo">
53+
/// Coded information
54+
/// </param>
55+
/// <param name="codedInfoArguments">
56+
/// Coded information arguments
57+
/// </param>
58+
public CodedInfoItem(CodedInfo codedInfo, String[] codedInfoArguments)
59+
{
60+
this.myCodedInfo = codedInfo;
61+
this.myCodedInfoArguments = codedInfoArguments;
62+
}
63+
64+
#endregion
65+
66+
////////////////////////////////////////////////////////////////////////////////
67+
68+
#region Public properties (get)
69+
70+
/// <summary>
71+
/// Coded information arguments
72+
/// </summary>
73+
/// <value>
74+
/// May be null
75+
/// </value>
76+
public String[] CodedInfoArguments
77+
{
78+
get
79+
{
80+
return this.myCodedInfoArguments;
81+
}
82+
}
83+
/// <summary>
84+
/// Coded information
85+
/// </summary>
86+
public CodedInfo CodedInfo
87+
{
88+
get
89+
{
90+
return this.myCodedInfo;
91+
}
92+
}
93+
94+
#endregion
95+
96+
}
97+
}

MathCompiler/IConstant.cs

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
// MathCompiler - Mathematical function compiler for calculation of function
2+
// values of arbitrary complex single-line mathematical formulas
3+
// Copyright (C) 2018 Achim Zielesny (achim.zielesny@googlemail.com)
4+
//
5+
// Source code is available at <https://github.com/zielesny/MathCompiler>
6+
//
7+
// This program is free software: you can redistribute it and/or modify
8+
// it under the terms of the GNU General Public License as published by
9+
// the Free Software Foundation, either version 3 of the License, or
10+
// (at your option) any later version.
11+
//
12+
// This program is distributed in the hope that it will be useful,
13+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
// GNU General Public License for more details.
16+
//
17+
// You should have received a copy of the GNU General Public License
18+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
20+
using System;
21+
using System.Collections.Generic;
22+
using System.Text;
23+
24+
namespace MathCompiler
25+
{
26+
/// <summary>
27+
/// Interface for math compiler constant
28+
/// </summary>
29+
public interface IConstant
30+
{
31+
32+
#region Properties
33+
34+
/// <summary>
35+
/// Description of constant (not allowed to be null/empty)
36+
/// </summary>
37+
/// <value>
38+
/// Not null/empty
39+
/// </value>
40+
String Description
41+
{
42+
get;
43+
}
44+
/// <summary>
45+
/// Name of constant (not allowed to be null/empty)
46+
/// </summary>
47+
/// <value>
48+
/// Not null/empty
49+
/// </value>
50+
String Name
51+
{
52+
get;
53+
}
54+
/// <summary>
55+
/// Value of constant
56+
/// </summary>
57+
/// <value>
58+
/// Arbitrary
59+
/// </value>
60+
Double Value
61+
{
62+
get;
63+
}
64+
65+
#endregion
66+
67+
}
68+
}

0 commit comments

Comments
 (0)