Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Required changes #21

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
989,673 changes: 989,673 additions & 0 deletions 4.a2l

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Asap2.Tests/.vs/Asap2.Tests.csproj.dtbcache.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"RootPath":"C:\\Users\\Ichiro\\source\\repos\\Asap2\\Asap2.Tests","ProjectFileName":"Asap2.Tests.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"ApiSpec.cs"},{"SourceFile":"ParserTests.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"UnitTestErrorReporter.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.8.AssemblyAttributes.cs"}],"References":[{"Reference":"C:\\Users\\Ichiro\\source\\repos\\Asap2\\Asap2\\bin\\Debug\\Asap2.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":true,"ProjectPath":"C:\\Users\\Ichiro\\source\\repos\\Asap2\\Asap2\\bin\\Debug\\Asap2.dll"},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Net.Http.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"C:\\Users\\Ichiro\\source\\repos\\Asap2\\Asap2.Tests\\bin\\Debug\\Asap2.Tests.dll","OutputItemRelativePath":"Asap2.Tests.dll"},{"OutputItemFullPath":"","OutputItemRelativePath":""}],"CopyToOutputEntries":[]}
10 changes: 8 additions & 2 deletions Asap2.sln
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio Version 17
VisualStudioVersion = 17.11.35431.28
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Asap2", "Asap2\Asap2.csproj", "{EFADEE96-3767-42C4-92D3-BF0095B70553}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Asap2Test", "Asap2Test\Asap2Test.csproj", "{449BBB8A-D579-4984-8FCE-E8173929309A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Asap2.Tests", "Asap2.Tests\Asap2.Tests.csproj", "{8B8F4BFF-0976-4F2D-A698-FBA980F27E80}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTest", "UnitTest\UnitTest.csproj", "{ED0DD788-391B-4F70-AA2C-924BD4DA8A75}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -27,6 +29,10 @@ Global
{8B8F4BFF-0976-4F2D-A698-FBA980F27E80}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8B8F4BFF-0976-4F2D-A698-FBA980F27E80}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8B8F4BFF-0976-4F2D-A698-FBA980F27E80}.Release|Any CPU.Build.0 = Release|Any CPU
{ED0DD788-391B-4F70-AA2C-924BD4DA8A75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ED0DD788-391B-4F70-AA2C-924BD4DA8A75}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ED0DD788-391B-4F70-AA2C-924BD4DA8A75}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ED0DD788-391B-4F70-AA2C-924BD4DA8A75}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
1 change: 1 addition & 0 deletions Asap2/.vs/Asap2.csproj.dtbcache.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"RootPath":"C:\\Projects\\Tests\\Asap2\\Asap2","ProjectFileName":"Asap2.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"Asap2Tree\\ADDRESS.cs"},{"SourceFile":"Asap2Tree\\Asap2Base.cs"},{"SourceFile":"Asap2Tree\\Asap2File.cs"},{"SourceFile":"Asap2Tree\\AXIS_PTS.cs"},{"SourceFile":"Asap2Tree\\COPY.cs"},{"SourceFile":"Asap2Tree\\DATA_ACCESS.cs"},{"SourceFile":"Asap2Tree\\CAN.cs"},{"SourceFile":"Asap2Tree\\CHECKSUM_PARAM.cs"},{"SourceFile":"Asap2Tree\\DAQ_EVENT.cs"},{"SourceFile":"Asap2Tree\\CAL_PARAM_GROUP.cs"},{"SourceFile":"Asap2Tree\\CHARACTERISTIC.cs"},{"SourceFile":"Asap2Tree\\CHECKSUM.cs"},{"SourceFile":"Asap2Tree\\COMPU_METHOD.cs"},{"SourceFile":"Asap2Tree\\DEFINED_PAGES.cs"},{"SourceFile":"Asap2Tree\\CODE_CHK.cs"},{"SourceFile":"Asap2Tree\\DIAG_BAUD.cs"},{"SourceFile":"Asap2Tree\\DISTAB_CFG.cs"},{"SourceFile":"Asap2Tree\\ETK_CFG.cs"},{"SourceFile":"Asap2Tree\\FLASH.cs"},{"SourceFile":"Asap2Tree\\KP_BLOB.cs"},{"SourceFile":"Asap2Tree\\PAGE_SWITCH.cs"},{"SourceFile":"Asap2Tree\\SESSION.cs"},{"SourceFile":"Asap2Tree\\TransportProtocolVersion.cs"},{"SourceFile":"Asap2Tree\\USDTP_TIMING_DEFAULTS.cs"},{"SourceFile":"Asap2Tree\\USDTP_TIMING.cs"},{"SourceFile":"Asap2Tree\\KWP_TIMING.cs"},{"SourceFile":"Asap2Tree\\K_LINE.cs"},{"SourceFile":"Asap2Tree\\NETWORK_LIMITS.cs"},{"SourceFile":"Asap2Tree\\PGM.cs"},{"SourceFile":"Asap2Tree\\PAG.cs"},{"SourceFile":"Asap2Tree\\DAQ_LIST.cs"},{"SourceFile":"Asap2Tree\\EVENT.cs"},{"SourceFile":"Asap2Tree\\RASTER.cs"},{"SourceFile":"Asap2Tree\\RESERVED_DISTAB_MEMORY.cs"},{"SourceFile":"Asap2Tree\\SECTOR.cs"},{"SourceFile":"Asap2Tree\\QP_BLOB.cs"},{"SourceFile":"Asap2Tree\\SEED_KEY.cs"},{"SourceFile":"Asap2Tree\\SOURCE.cs"},{"SourceFile":"Asap2Tree\\TIMESTAMP_SUPPORTED.cs"},{"SourceFile":"Asap2Tree\\DAQ.cs"},{"SourceFile":"Asap2Tree\\FileComment.cs"},{"SourceFile":"Asap2Tree\\IF_DATA.cs"},{"SourceFile":"Asap2Tree\\MEASUREMENT.cs"},{"SourceFile":"Asap2Tree\\PAGE.cs"},{"SourceFile":"Asap2Tree\\PROTOCOL_LAYER.cs"},{"SourceFile":"Asap2Tree\\SEGMENT.cs"},{"SourceFile":"Asap2Tree\\TIME_DEF.cs"},{"SourceFile":"Asap2Tree\\TP_BLOB.cs"},{"SourceFile":"Asap2Tree\\XCP_ON_CAN.cs"},{"SourceFile":"Attributes.cs"},{"SourceFile":"Asap2Tree\\DEF_CHARACTERISTIC.cs"},{"SourceFile":"Asap2Tree\\FRAME.cs"},{"SourceFile":"Asap2Tree\\FUNCTION.cs"},{"SourceFile":"Asap2Tree\\IN_MEASUREMENT.cs"},{"SourceFile":"Asap2Tree\\LOC_MEASUREMENT.cs"},{"SourceFile":"Asap2Tree\\MODULE.cs"},{"SourceFile":"Asap2Tree\\OUT_MEASUREMENT.cs"},{"SourceFile":"Asap2Tree\\REF_CHARACTERISTIC.cs"},{"SourceFile":"Asap2Tree\\SI_EXPONENTS.cs"},{"SourceFile":"Asap2Tree\\SUB_FUNCTION.cs"},{"SourceFile":"Asap2Tree\\UNIT.cs"},{"SourceFile":"Asap2Tree\\UNIT_CONVERSION.cs"},{"SourceFile":"Asap2Tree\\USER_RIGHTS.cs"},{"SourceFile":"Asap2Tree\\VARIANT_CODING.cs"},{"SourceFile":"Asap2Tree\\VAR_CHARACTERISTIC.cs"},{"SourceFile":"Asap2Tree\\VAR_CRITERION.cs"},{"SourceFile":"Asap2Tree\\VAR_FORBIDDEN_COMB.cs"},{"SourceFile":"ErrorHandler.cs"},{"SourceFile":"GplexBuffers.cs"},{"SourceFile":"IErrorReporter.cs"},{"SourceFile":"Location.cs"},{"SourceFile":"Parser.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"ShiftReduceParserCode.cs"},{"SourceFile":"tools\\Remover.cs"},{"SourceFile":"tools\\Options.cs"},{"SourceFile":"tools\\Merger.cs"},{"SourceFile":"Asap2.Parser.cs"},{"SourceFile":"Asap2.Parser.Generated.cs"},{"SourceFile":"Asap2.Scanner.cs"},{"SourceFile":"Asap2.Scanner.Generated.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.8.AssemblyAttributes.cs"}],"References":[{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"C:\\Projects\\Tests\\Asap2\\Asap2\\bin\\Debug\\Asap2.dll","OutputItemRelativePath":"Asap2.dll"},{"OutputItemFullPath":"","OutputItemRelativePath":""}],"CopyToOutputEntries":[]}
68 changes: 57 additions & 11 deletions Asap2/Asap2.Language.analyzer.lex
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

Identifier [A-Za-z_][A-Za-z0-9_\.\[\]]*
Space [ \t\u000c]
Decimal [\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?
Decimal [\-+]?[0-9]+(\.[0-9]*)?([eE][\-+]?[0-9]+)?
HexNumber 0x[0-9A-Fa-f]+
Eol (\r?\n)
Alignment ALIGNMENT_[A-Za-z0-9_]+
Expand All @@ -27,7 +27,7 @@ CommentEnd \*\/
LineComment ("//"[^\n]*)

%x STATE_STRING
%x STATE_IF_DATA
//%x STATE_IF_DATA
%x STATE_A2ML
%x ML_COMMENT
%x STATE_INCL
Expand Down Expand Up @@ -173,28 +173,74 @@ VARIANT_CODING { return Make(Token.VARIANT_CODING); }
VAR_FORBIDDEN_COMB { return Make(Token.VAR_FORBIDDEN_COMB); }
VAR_SEPERATOR { return Make(Token.VAR_SEPERATOR); }
VAR_NAMING { return Make(Token.VAR_NAMING); }
IF_DATA { yy_push_state (STATE_IF_DATA); yylval.sb = new StringBuilder(); }
IF_DATA { return Make(Token.IF_DATA); }
SEGMENT { return Make(Token.SEGMENT); }
CHECKSUM { return Make(Token.CHECKSUM); }
PAGE { return Make(Token.PAGE); }
CAL_PARAM_GROUP { return Make(Token.CAL_PARAM_GROUP); }
PROTOCOL_LAYER { return Make(Token.PROTOCOL_LAYER); }
DAQ_LIST { return Make(Token.DAQ_LIST); }
DAQ { return Make(Token.DAQ); }
TIMESTAMP_SUPPORTED { return Make(Token.TIMESTAMP_SUPPORTED); }
EVENT { return Make(Token.EVENT); }
PAG { return Make(Token.PAG); }
PGM { return Make(Token.PGM); }
SECTOR { return Make(Token.SECTOR); }
XCP_ON_CAN { return Make(Token.XCP_ON_CAN); }
DAQ_EVENT { return Make(Token.DAQ_EVENT); }
TP_BLOB { return Make(Token.TP_BLOB); }
QP_BLOB { return Make(Token.QP_BLOB); }
SOURCE { return Make(Token.SOURCE); }
RASTER { return Make(Token.RASTER); }
SEED_KEY { return Make(Token.SEED_KEY); }
CHECKSUM_PARAM { return Make(Token.CHECKSUM_PARAM); }
DEFINED_PAGES { return Make(Token.DEFINED_PAGES); }
OPTIONAL_CMD { return Make(Token.OPTIONAL_CMD); }
DISTAB_CFG { return Make(Token.DISTAB_CFG); }
CODE_CHK { return Make(Token.CODE_CHK); }
ETK_CFG { return Make(Token.ETK_CFG); }
RESERVED_DISTAB_MEMORY { return Make(Token.RESERVED_DISTAB_MEMORY); }
K_LINE { return Make(Token.K_LINE); }
CAN { return Make(Token.CAN); }
ADDRESS { return Make(Token.ADDRESS); }
NETWORK_LIMITS { return Make(Token.NETWORK_LIMITS); }
DATA_ACCESS { return Make(Token.DATA_ACCESS); }
COPY { return Make(Token.COPY); }
FLASH { return Make(Token.FLASH); }
DIAG_BAUD { return Make(Token.DIAG_BAUD); }
TIME_DEF { return Make(Token.TIME_DEF); }
KWP_TIMING { return Make(Token.KWP_TIMING); }
USDTP_TIMING { return Make(Token.USDTP_TIMING); }
PAGE_SWITCH { return Make(Token.PAGE_SWITCH); }
SESSION { return Make(Token.SESSION); }
TransportProtocolVersion { return Make(Token.TransportProtocolVersion); }
USDTP_TIMING_DEFAULTS { return Make(Token.USDTP_TIMING_DEFAULTS); }
USDTP_TIMING { return Make(Token.USDTP_TIMING); }
KP_BLOB { return Make(Token.KP_BLOB); }
DEFAULT_EVENT_LIST { return Make(Token.DEFAULT_EVENT_LIST); }
A2ML { yy_push_state (STATE_A2ML); yylval.sb = new StringBuilder(); }

"\/include" { yy_push_state(STATE_INCL); }
\" { yy_push_state(STATE_STRING); yylval.sb = new StringBuilder(); }
{Identifier} { return Make(Token.IDENTIFIER); }
{HexNumber} { return MakeHexNumber(); }
{Decimal} { return MakeNumber(); }



<STATE_INCL>{
{Eol} { yy_pop_state(); TryInclude(null); }
[ \t] /* skip whitespace */
[^ \t]{IncFile} { yy_pop_state(); TryInclude(yytext); }
}

<STATE_IF_DATA> {
"\/end IF_DATA" { yy_pop_state(); return MakeStringBuilder(Token.IF_DATA); }
\\. { yylval.sb.Append(yytext); }
\r?\n { yylval.sb.Append("\r\n"); }
. { yylval.sb.Append(yytext); }
<<EOF>> { ; /* raise an error. */ }
}

//<STATE_IF_DATA> {
// "\/end IF_DATA" { yy_pop_state(); return MakeStringBuilder(Token.IF_DATA); }
// \\. { yylval.sb.Append(yytext); }
// \r?\n { yylval.sb.Append("\r\n"); }
// . { yylval.sb.Append(yytext); }
// <<EOF>> { ; /* raise an error. */ }
//}

<STATE_A2ML> {
"\/end A2ML" { yy_pop_state(); return MakeStringBuilder(Token.A2ML); }
Expand Down
Loading