Skip to content
Permalink
Browse files

Prototype implementation parsing to AST into existing parser

  • Loading branch information...
pascalpfeil committed Apr 14, 2018
1 parent 19bfc48 commit d44b50df2721f5b280d7d5321e37f961c2f7a073
Showing with 1,530 additions and 283 deletions.
  1. +3 −0 Models/Lustre Models/Lustre Models.csproj
  2. +3 −0 SafetyLustreTest/SafetyLustreTest.csproj
  3. +13 −0 Source/SafetyLustre/AST/AbstractSyntaxTree.cs
  4. +15 −0 Source/SafetyLustre/AST/Automaton/AutomatonElement.cs
  5. +9 −0 Source/SafetyLustre/AST/Automaton/CallsElement.cs
  6. +9 −0 Source/SafetyLustre/AST/Automaton/StartpointElement.cs
  7. +14 −0 Source/SafetyLustre/AST/Automaton/StateElement.cs
  8. +18 −0 Source/SafetyLustre/AST/Automaton/StatesElement.cs
  9. +12 −0 Source/SafetyLustre/AST/Element.cs
  10. +12 −0 Source/SafetyLustre/AST/ModuleElement.cs
  11. +15 −0 Source/SafetyLustre/AST/RootElement.cs
  12. +12 −0 Source/SafetyLustre/AST/Tables/Actions/ActionElement.cs
  13. +15 −0 Source/SafetyLustre/AST/Tables/Actions/ActionElementCall.cs
  14. +16 −0 Source/SafetyLustre/AST/Tables/Actions/ActionElementDsz.cs
  15. +13 −0 Source/SafetyLustre/AST/Tables/Actions/ActionElementIf.cs
  16. +13 −0 Source/SafetyLustre/AST/Tables/Actions/ActionElementOutput.cs
  17. +13 −0 Source/SafetyLustre/AST/Tables/Actions/ActionElementPresent.cs
  18. +18 −0 Source/SafetyLustre/AST/Tables/Actions/ActionsElement.cs
  19. +15 −0 Source/SafetyLustre/AST/Tables/Constants/ConstantElement.cs
  20. +18 −0 Source/SafetyLustre/AST/Tables/Constants/ConstantsElement.cs
  21. +13 −0 Source/SafetyLustre/AST/Tables/Signals/SignalBools/SignalBool.cs
  22. +12 −0 Source/SafetyLustre/AST/Tables/Signals/SignalChannels/SignalChannel.cs
  23. +14 −0 Source/SafetyLustre/AST/Tables/Signals/SignalChannels/SignalChannelMultiple.cs
  24. +12 −0 Source/SafetyLustre/AST/Tables/Signals/SignalChannels/SignalChannelPure.cs
  25. +13 −0 Source/SafetyLustre/AST/Tables/Signals/SignalChannels/SignalChannelSingle.cs
  26. +18 −0 Source/SafetyLustre/AST/Tables/Signals/SignalElement.cs
  27. +12 −0 Source/SafetyLustre/AST/Tables/Signals/SignalNatures/SignalNature.cs
  28. +14 −0 Source/SafetyLustre/AST/Tables/Signals/SignalNatures/SignalNatureInput.cs
  29. +14 −0 Source/SafetyLustre/AST/Tables/Signals/SignalNatures/SignalNatureOutput.cs
  30. +18 −0 Source/SafetyLustre/AST/Tables/Signals/SignalsElement.cs
  31. +28 −0 Source/SafetyLustre/AST/Tables/TablesElement.cs
  32. +14 −0 Source/SafetyLustre/AST/Tables/Variables/VariableElement.cs
  33. +18 −0 Source/SafetyLustre/AST/Tables/Variables/VariablesElement.cs
  34. +13 −0 Source/SafetyLustre/AST/VersionElement.cs
  35. +4 −4 Source/SafetyLustre/ModelChecking/LustreExecutableModel.cs
  36. +60 −37 Source/SafetyLustre/Node.cs
  37. +850 −150 Source/SafetyLustre/Parser.cs
  38. +38 −21 Source/SafetyLustre/PredefinedObjects.cs
  39. +76 −71 Source/SafetyLustre/Program.cs
  40. +33 −0 Source/SafetyLustre/SafetyLustre.csproj
@@ -86,6 +86,9 @@
<Name>SafetyLustre</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
@@ -104,6 +104,9 @@
<ItemGroup>
<Analyzer Include="..\Dependencies\xunit.analyzers.0.7.0\analyzers\dotnet\cs\xunit.analyzers.dll" />
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SafetyLustre.AST
{
class AbstractSyntaxTree
{
public RootElement Root { get; set; }
}
}
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SafetyLustre.AST.Automaton
{
class AutomatonElement : Element
{
public StatesElement States { get; set; }
public StartpointElement Startpoint { get; set; }
public CallsElement Calls{ get; set; }
}
}
@@ -0,0 +1,9 @@
using System.Collections.Generic;

namespace SafetyLustre.AST.Automaton
{
class CallsElement : Element
{
public string Count { get; set; }
}
}
@@ -0,0 +1,9 @@
using System;

namespace SafetyLustre.AST.Automaton
{
class StartpointElement : Element
{
public string Value { get; set; }
}
}
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SafetyLustre.AST.Automaton
{
class StateElement : Element
{
//TODO
public string CallString { get; set; }
}
}
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SafetyLustre.AST.Automaton
{
class StatesElement : Element
{
public List<StateElement> Children { get; set; }

public StatesElement()
{
Children = new List<StateElement>();
}
}
}
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SafetyLustre.AST
{
abstract class Element
{
}
}
@@ -0,0 +1,12 @@
using SafetyLustre.AST.Automaton;
using SafetyLustre.AST.Tables;

namespace SafetyLustre.AST
{
class ModuleElement : Element
{
public string Name { get; set; }
public TablesElement Tables { get; set; }
public AutomatonElement Automaton { get; set; }
}
}
@@ -0,0 +1,15 @@
using SafetyLustre.AST.Tables;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SafetyLustre.AST
{
class RootElement : Element
{
public VersionElement Version { get; set; }
public ModuleElement Module { get; set; }
}
}
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SafetyLustre.AST.Tables.Actions
{
abstract class ActionElement : Element
{
}
}
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SafetyLustre.AST.Tables.Actions
{
class ActionElementCall : ActionElement
{
public string ProcedureIndex { get; set; }
public string VariableIndexList { get; set; }
public string ExpressionList { get; set; }
}
}
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SafetyLustre.AST.Tables.Actions
{
/// <summary>
/// Decrement and skip on zero
/// </summary>
class ActionElementDsz : ActionElement
{
public string VariableIndex { get; set; }
}
}
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SafetyLustre.AST.Tables.Actions
{
class ActionElementIf : ActionElement
{
public string Expression { get; set; }
}
}
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SafetyLustre.AST.Tables.Actions
{
class ActionElementOutput : ActionElement
{
public string SignalIndex { get; set; }
}
}
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SafetyLustre.AST.Tables.Actions
{
class ActionElementPresent : ActionElement
{
public string SignalIndex { get; set; }
}
}
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SafetyLustre.AST.Tables.Actions
{
class ActionsElement : Element
{
public List<ActionElement> Children { get; set; }

public ActionsElement()
{
Children = new List<ActionElement>();
}
}
}
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SafetyLustre.AST.Tables.Constants
{
class ConstantElement : Element
{
public string Name { get; set; }
public string TypeIndex { get; set; }
public string Value { get; set; }
}
}
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SafetyLustre.AST.Tables.Constants
{
class ConstantsElement : Element
{
public List<ConstantElement> Children { get; set; }

public ConstantsElement()
{
Children = new List<ConstantElement>();
}
}
}
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SafetyLustre.AST.Tables.Signals.SignalBools
{
class SignalBool : Element
{
public string BoolVarIndex { get; set; }
}
}
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SafetyLustre.AST.Tables.Signals.SignalChannels
{
abstract class SignalChannel : Element
{
}
}
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SafetyLustre.AST.Tables.Signals.SignalChannels
{
class SignalChannelMultiple : SignalChannel
{
public string VarIndex { get; set; }
public string CombFunIndex { get; set; }
}
}
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SafetyLustre.AST.Tables.Signals.SignalChannels
{
class SignalChannelPure : SignalChannel
{
}
}
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SafetyLustre.AST.Tables.Signals.SignalChannels
{
class SignalChannelSingle : SignalChannel
{
public string VarIndex { get; set; }
}
}
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SafetyLustre.AST.Tables.Signals.SignalBools;
using SafetyLustre.AST.Tables.Signals.SignalChannels;
using SafetyLustre.AST.Tables.Signals.SignalNatures;

namespace SafetyLustre.AST.Tables.Signals
{
class SignalElement : Element
{
public SignalNature Nature { get; set; }
public SignalChannel Channel { get; set; }
public SignalBool Bool { get; set; }
}
}
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SafetyLustre.AST.Tables.Signals.SignalNatures
{
abstract class SignalNature : Element
{
}
}
Oops, something went wrong.

0 comments on commit d44b50d

Please sign in to comment.
You can’t perform that action at this time.