Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
DeanLee77 committed Sep 24, 2018
1 parent 7aede35 commit 58bdd0c
Show file tree
Hide file tree
Showing 87 changed files with 2,645 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .vs/Nadia.C.Sharp/xs/UserPrefs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<Properties StartupConfiguration="{E5A172D3-CE33-4031-84EA-35835913261E}|Default">
<MonoDevelop.Ide.Workbench ActiveDocument="Nadia.C.Sharp/Node Folder/Node.cs">
<Files>
<File FileName="Nadia.C.Sharp/Program.cs" Line="27" Column="1" />
<File FileName="Nadia.C.Sharp/FactValue Folder/FactListValue.cs" Line="16" Column="9" />
<File FileName="Nadia.C.Sharp/FactValue Folder/FactValue.cs" Line="43" Column="10" />
<File FileName="Nadia.C.Sharp/Node Folder/ComparisonLine.cs" Line="12" Column="13" />
<File FileName="Nadia.C.Sharp/Node Folder/Node.cs" Line="12" Column="35" />
<File FileName="Nadia.C.Sharp/RuleParser Folder/Tokens.cs" Line="20" Column="13" />
<File FileName="Nadia.C.Sharp/RuleParser Folder/Tokenizer.cs" Line="22" Column="88" />
</Files>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|x86" />
<MonoDevelop.Ide.DebuggingService.Breakpoints>
<BreakpointStore />
</MonoDevelop.Ide.DebuggingService.Breakpoints>
<MonoDevelop.Ide.DebuggingService.PinnedWatches />
<MultiItemStartupConfigurations />
<MonoDevelop.Ide.ItemProperties.Nadia.C.Sharp PreferredExecutionTarget="MonoDevelop.Default" />
</Properties>
Empty file.
Binary file added .vs/Nadia.C.Sharp/xs/sqlite3/storage.ide
Binary file not shown.
Binary file added .vs/Nadia.C.Sharp/xs/sqlite3/storage.ide-shm
Binary file not shown.
Binary file added .vs/Nadia.C.Sharp/xs/sqlite3/storage.ide-wal
Binary file not shown.
17 changes: 17 additions & 0 deletions Nadia.C.Sharp.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nadia.C.Sharp", "Nadia.C.Sharp\Nadia.C.Sharp.csproj", "{E5A172D3-CE33-4031-84EA-35835913261E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E5A172D3-CE33-4031-84EA-35835913261E}.Debug|x86.ActiveCfg = Debug|x86
{E5A172D3-CE33-4031-84EA-35835913261E}.Debug|x86.Build.0 = Debug|x86
{E5A172D3-CE33-4031-84EA-35835913261E}.Release|x86.ActiveCfg = Release|x86
{E5A172D3-CE33-4031-84EA-35835913261E}.Release|x86.Build.0 = Release|x86
EndGlobalSection
EndGlobal
19 changes: 19 additions & 0 deletions Nadia.C.Sharp/.vs/Nadia.C.Sharp/xs/UserPrefs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Properties StartupConfiguration="{E5A172D3-CE33-4031-84EA-35835913261E}|Default">
<MonoDevelop.Ide.Workbench ActiveDocument="Node Folder/ComparisonLine.cs">
<Files>
<File FileName="RuleParser Folder/Tokenizer.cs" Line="10" Column="62" />
<File FileName="Program.cs" Line="95" Column="25" />
<File FileName="Node Folder/ComparisonLine.cs" Line="81" Column="116" />
<File FileName="Node Folder/ExprConclusionLine.cs" Line="86" Column="61" />
<File FileName="Node Folder/Node.cs" Line="92" Column="21" />
<File FileName="FactValue Folder/FactDateValue.cs" Line="6" Column="17" />
</Files>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|x86" />
<MonoDevelop.Ide.DebuggingService.Breakpoints>
<BreakpointStore />
</MonoDevelop.Ide.DebuggingService.Breakpoints>
<MonoDevelop.Ide.DebuggingService.PinnedWatches />
<MultiItemStartupConfigurations />
<MonoDevelop.Ide.ItemProperties.Nadia.C.Sharp PreferredExecutionTarget="MonoDevelop.Default" />
</Properties>
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
49 changes: 49 additions & 0 deletions Nadia.C.Sharp/FactValue Folder/FactBooleanValue.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
using System;
namespace Nadia.C.Sharp.FactValueFolder
{
public class FactBooleanValue<T> : FactValue<T>
{
private bool value;
private bool? defaultValue; //bool? means nullable bool primative type

public FactBooleanValue(bool booleanValue)
{
SetValue(booleanValue);
}


public void SetValue(bool booleanValue)
{
this.value = booleanValue;
}

public FactValue<T> NegatingValue()
{
return FactValue<T>.Parse(!this.value);
}

public override FactValueType GetFactValueType()
{
return FactValueType.BOOLEAN;
}


public override void SetDefaultValue(T defaultValue)
{
this.defaultValue = (bool)Convert.ChangeType(defaultValue, typeof(bool));
}


public override T GetValue()
{
return (T)Convert.ChangeType(this.value, typeof(T));
}


public override T GetDefaultValue()
{
return (T)Convert.ChangeType(this.defaultValue, typeof(T));
}

}
}
44 changes: 44 additions & 0 deletions Nadia.C.Sharp/FactValue Folder/FactDateValue.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using System;
namespace Nadia.C.Sharp.FactValueFolder
{
public class FactDateValue<T> : FactValue<T>
{
private DateTime value;
private DateTime defaultValue;

public FactDateValue(DateTime date)
{
SetValue(date);
}

public void SetValue(DateTime cal)
{
this.value = cal;
}


public override T GetValue()
{
return (T)Convert.ChangeType(this.value, typeof(T));
}



public override T GetDefaultValue()
{
return (T)Convert.ChangeType(this.defaultValue, typeof(T));
}


public override FactValueType GetFactValueType()
{
return FactValueType.DATE;
}

public override void SetDefaultValue(T defaultValue)
{
this.defaultValue = (DateTime)Convert.ChangeType(defaultValue, typeof(DateTime));
}

}
}
50 changes: 50 additions & 0 deletions Nadia.C.Sharp/FactValue Folder/FactDefiStringValue.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
using System;
using System.Text.RegularExpressions;

namespace Nadia.C.Sharp.FactValueFolder
{
public class FactDefiStringValue<T> : FactValue<T>
{
private string value;
private string defaultValue;
private string pattern = @"^("")(.*)("")(.)*";
//private Regex regex = new Regex(pattern);
private Match match;

public FactDefiStringValue(string s)
{
match = Regex.Match(s, pattern);
if (match.Success)
{
SetValue(match.Groups[2].Value);
}
}
public void SetValue(string s)
{
this.value = s;
}


public override FactValueType GetFactValueType()
{
return FactValueType.DEFI_STRING;
}

public override void SetDefaultValue(T defaultValue)
{
this.defaultValue = defaultValue.ToString();
}

public override T GetValue()
{
// TODO Auto-generated method stub
return (T)Convert.ChangeType(this.value, typeof(T));
}

public override T GetDefaultValue()
{
// TODO Auto-generated method stub
return (T)Convert.ChangeType(this.defaultValue, typeof(T));
}
}
}
45 changes: 45 additions & 0 deletions Nadia.C.Sharp/FactValue Folder/FactDoubleValue.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using System;
namespace Nadia.C.Sharp.FactValueFolder
{
public class FactDoubleValue<T> : FactValue<T>
{
private double value;
private double? defaultValue; //double? means nullable double primative type

public FactDoubleValue(double d)
{
SetValue(d);
}

public void SetValue(double d)
{
this.value = d;
}


public override T GetValue()
{
return (T)Convert.ChangeType(this.value, typeof(T));
}



public override T GetDefaultValue()
{
return (T)Convert.ChangeType(this.defaultValue, typeof(T));
}


public override FactValueType GetFactValueType()
{
return FactValueType.DECIMAL;
}


public override void SetDefaultValue(T defaultValue)
{
this.defaultValue = (double)Convert.ChangeType(defaultValue, typeof(double));
}

}
}
46 changes: 46 additions & 0 deletions Nadia.C.Sharp/FactValue Folder/FactHashValue.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
using System;
namespace Nadia.C.Sharp.FactValueFolder
{
public class FactHashValue<T> : FactValue<T>
{
private String value;
private String defaultValue;

public FactHashValue(String hash)
{
SetValue(hash);
}



public void SetValue(String hash)
{
this.value = hash;
}


public override FactValueType GetFactValueType()
{
return FactValueType.HASH;
}


public override void SetDefaultValue(T defaultValue)
{
this.defaultValue = (string)Convert.ChangeType(defaultValue, typeof(string));
}


public override T GetValue()
{
return (T)Convert.ChangeType(this.value, typeof(T));
}


public override T GetDefaultValue()
{
return (T)Convert.ChangeType(this.defaultValue, typeof(T));
}

}
}
49 changes: 49 additions & 0 deletions Nadia.C.Sharp/FactValue Folder/FactIntegerValue.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
using System;
namespace Nadia.C.Sharp.FactValueFolder
{
public class FactIntegerValue<T> : FactValue<T>
{
private int value;
private int? defaultValue = null; //int? means nullable int primative type

public FactIntegerValue(int i)
{
SetValue(i);
}



public void SetValue(int value)
{
this.value = value;
}



public override FactValueType GetFactValueType()
{
return FactValueType.INTEGER;
}


public override void SetDefaultValue(T defaultValue)
{
this.defaultValue = (int)Convert.ChangeType(defaultValue, typeof(int));
}


public override T GetValue()
{
return (T)Convert.ChangeType(this.value, typeof(T));
}



public override T GetDefaultValue()
{
// TODO Auto-generated method stub
return (T)Convert.ChangeType(this.defaultValue, typeof(T));
}

}
}
Loading

0 comments on commit 58bdd0c

Please sign in to comment.