Skip to content

Commit

Permalink
Added Tool to calculate keyword hash values
Browse files Browse the repository at this point in the history
Fixed Namespace detection
  • Loading branch information
JeroenVandezande committed Sep 27, 2013
1 parent 4656383 commit 810350c
Show file tree
Hide file tree
Showing 13 changed files with 411 additions and 1 deletion.
11 changes: 10 additions & 1 deletion CastaliaPasLex.pas
Expand Up @@ -158,6 +158,7 @@ TmwBasePasLex = class(TObject)
function Func73: TptTokenKind;
function Func75: TptTokenKind;
function Func76: TptTokenKind;
function Func77: TptTokenKind;
function Func78: TptTokenKind;
function Func79: TptTokenKind;
function Func81: TptTokenKind;
Expand Down Expand Up @@ -327,7 +328,7 @@ TmwBasePasLex = class(TObject)
{$ENDIF}
property CompilerDirective: String read GetCompilerDirective;
property DirectiveParam: String read GetDirectiveParam;
property IsJunk: Boolean read GetIsJunk;
property IsJunk: Boolean read GetIsJunk;
property IsSpace: Boolean read GetIsSpace;
property Line: String read GetLine write SetLine;
//Note: setting the following two properties does not GO to that line, it just sets the internal counters
Expand Down Expand Up @@ -588,6 +589,7 @@ procedure TmwBasePasLex.InitIdent;
73: fIdentFuncTable[I] := @Func73;
75: fIdentFuncTable[I] := @Func75;
76: fIdentFuncTable[I] := @Func76;
77: fIdentFuncTable[I] := @Func77;
78: fIdentFuncTable[I] := @Func78;
79: fIdentFuncTable[I] := @Func79;
81: fIdentFuncTable[I] := @Func81;
Expand Down Expand Up @@ -688,6 +690,7 @@ procedure TmwBasePasLex.InitIdent;
73: fIdentFuncTable[I] := Func73;
75: fIdentFuncTable[I] := Func75;
76: fIdentFuncTable[I] := Func76;
77: fIdentFuncTable[I] := Func77;
78: fIdentFuncTable[I] := Func78;
79: fIdentFuncTable[I] := Func79;
81: fIdentFuncTable[I] := Func81;
Expand Down Expand Up @@ -1131,6 +1134,12 @@ function TmwBasePasLex.Func76: TptTokenKind;
if KeyComp('Until') then Result := TptTokenKind.ptUntil;
end;

function TmwBasePasLex.Func77: TptTokenKind;
begin
Result := TptTokenKind.ptIdentifier;
if KeyComp('Namespace') then Result := TptTokenKind.ptUnit;
end;

function TmwBasePasLex.Func78: TptTokenKind;
begin
Result := TptTokenKind.ptIdentifier;
Expand Down
10 changes: 10 additions & 0 deletions KeywordHashCalculator/App.xaml
@@ -0,0 +1,10 @@
<?xml version='1.0' encoding='utf-8' ?>
<Application x:Class="KeywordHashCalculator.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="Window1.xaml"
>
<Application.Resources>

</Application.Resources>
</Application>
18 changes: 18 additions & 0 deletions KeywordHashCalculator/App.xaml.pas
@@ -0,0 +1,18 @@
namespace KeywordHashCalculator;

interface

uses
System.Windows,
System.Data,
System.Xml,
System.Configuration;

type
App = public partial class(System.Windows.Application)

end;

implementation

end.
103 changes: 103 additions & 0 deletions KeywordHashCalculator/KeywordHashCalculator.oxygene
@@ -0,0 +1,103 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<ProductVersion>3.5</ProductVersion>
<ProjectGuid>{c35c7fe4-bd19-4081-b206-c1f9b43a2792}</ProjectGuid>
<RootNamespace>KeywordHashCalculator</RootNamespace>
<OutputType>winexe</OutputType>
<AssemblyName>KeywordHashCalculator</AssemblyName>
<AllowGlobals>False</AllowGlobals>
<AllowLegacyWith>False</AllowLegacyWith>
<AllowLegacyOutParams>False</AllowLegacyOutParams>
<AllowLegacyCreate>False</AllowLegacyCreate>
<AllowUnsafeCode>False</AllowUnsafeCode>
<ApplicationIcon>Properties\App.ico</ApplicationIcon>
<ProjectTypeGuids>{89896941-7261-4476-8385-4DA3CE9FDB83};{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{656346D9-4656-40DA-A068-22D5425D4639}</ProjectTypeGuids>
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<Name>KeywordHashCalculator</Name>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<Conditionals>DEBUG;TRACE</Conditionals>
<OutputPath>.\bin\Debug\</OutputPath>
<GeneratePDB>True</GeneratePDB>
<GenerateMDB>True</GenerateMDB>
<EnableAsserts>True</EnableAsserts>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<CaptureConsoleOutput>False</CaptureConsoleOutput>
<StartMode>Project</StartMode>
<RegisterForComInterop>False</RegisterForComInterop>
<CpuType>anycpu</CpuType>
<RuntimeVersion>v25</RuntimeVersion>
<XmlDoc>False</XmlDoc>
<XmlDocWarningLevel>WarningOnPublicMembers</XmlDocWarningLevel>
<EnableUnmanagedDebugging>False</EnableUnmanagedDebugging>
<WarnOnCaseMismatch>True</WarnOnCaseMismatch>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<OutputPath>.\bin\Release</OutputPath>
<GeneratePDB>False</GeneratePDB>
<GenerateMDB>False</GenerateMDB>
<EnableAsserts>False</EnableAsserts>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<CaptureConsoleOutput>False</CaptureConsoleOutput>
<StartMode>Project</StartMode>
<RegisterForComInterop>False</RegisterForComInterop>
<CpuType>anycpu</CpuType>
<RuntimeVersion>v25</RuntimeVersion>
<XmlDoc>False</XmlDoc>
<XmlDocWarningLevel>WarningOnPublicMembers</XmlDocWarningLevel>
<EnableUnmanagedDebugging>False</EnableUnmanagedDebugging>
<WarnOnCaseMismatch>True</WarnOnCaseMismatch>
</PropertyGroup>
<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="ReachFramework" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="UIAutomationProvider" />
<Reference Include="UIAutomationTypes" />
<Reference Include="WindowsBase" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml" />
<Compile Include="App.xaml.pas" />
<Page Include="Window1.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Compile Include="Window1.xaml.pas" />
<None Include="Properties\App.ico" />
<Compile Include="Properties\AssemblyInfo.pas" />
<Compile Include="Properties\Resources.Designer.pas" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
</EmbeddedResource>
<Compile Include="Properties\Settings.Designer.pas" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
</None>
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\RemObjects Software\Oxygene\RemObjects.Oxygene.Echoes.targets" />
<PropertyGroup>
<PreBuildEvent />
</PropertyGroup>
</Project>
20 changes: 20 additions & 0 deletions KeywordHashCalculator/KeywordHashCalculator.sln
@@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{656346D9-4656-40DA-A068-22D5425D4639}") = "KeywordHashCalculator", "KeywordHashCalculator.oxygene", "{C35C7FE4-BD19-4081-B206-C1F9B43A2792}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Default = Debug|Default
Release|Default = Release|Default
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C35C7FE4-BD19-4081-B206-C1F9B43A2792}.Debug|Default.ActiveCfg = Debug
{C35C7FE4-BD19-4081-B206-C1F9B43A2792}.Debug|Default.Build.0 = Debug
{C35C7FE4-BD19-4081-B206-C1F9B43A2792}.Release|Default.ActiveCfg = Release
{C35C7FE4-BD19-4081-B206-C1F9B43A2792}.Release|Default.Build.0 = Release
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Binary file added KeywordHashCalculator/Properties/App.ico
Binary file not shown.
53 changes: 53 additions & 0 deletions KeywordHashCalculator/Properties/AssemblyInfo.pas
@@ -0,0 +1,53 @@
namespace KeywordHashCalculator;

interface

uses
System.Reflection,
System.Resources,
System.Runtime.InteropServices;

[assembly: AssemblyTitle('')]
[assembly: AssemblyDescription('')]
[assembly: AssemblyConfiguration('')]
[assembly: AssemblyCompany('')]
[assembly: AssemblyProduct('')]
[assembly: AssemblyCopyright('')]
[assembly: AssemblyTrademark('')]
[assembly: AssemblyCulture('')]
[assembly: AssemblyVersion('1.0.0.1')]
[assembly: NeutralResourcesLanguage('')]
[assembly: ComVisible(false)]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
// (*) If no key is specified, the assembly is not signed.
// (*) KeyName refers to a key that has been installed in the Crypto Service
// Provider (CSP) on your machine. KeyFile refers to a file which contains
// a key.
// (*) If the KeyFile and the KeyName values are both specified, the
// following processing occurs:
// (1) If the KeyName can be found in the CSP, that key is used.
// (2) If the KeyName does not exist and the KeyFile does exist, the key
// in the KeyFile is installed into the CSP and used.
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
// When specifying the KeyFile, the location of the KeyFile should be
// relative to the project output directory, which in Oxygene by default is the
// same as the project directory. For example, if your KeyFile is
// located in the project directory, you would specify the AssemblyKeyFile
// attribute as [assembly: AssemblyKeyFile('mykey.snk')]
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
// documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile('')]
[assembly: AssemblyKeyName('')]

implementation

end.
10 changes: 10 additions & 0 deletions KeywordHashCalculator/Properties/Resources.Designer.pas
@@ -0,0 +1,10 @@
namespace KeywordHashCalculator;

interface

{ The .Designer.pas file will be automatically generated when the parent file changes.
You can also right-click the parent file and select 'Run Custom Tool' to update it now. }

implementation

end.
117 changes: 117 additions & 0 deletions KeywordHashCalculator/Properties/Resources.resx
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
10 changes: 10 additions & 0 deletions KeywordHashCalculator/Properties/Settings.Designer.pas
@@ -0,0 +1,10 @@
namespace KeywordHashCalculator;

interface

{ The .Designer.pas file will be automatically generated when the parent file changes.
You can also right-click the parent file and select 'Run Custom Tool' to update it now. }

implementation

end.

0 comments on commit 810350c

Please sign in to comment.