├── .gitattributes
├── Aphid
├── Aphid.csproj
├── Aphid.csproj.vspscc
├── App.config
├── HelloWorld.alx
├── Program.cs
└── Properties
│ └── AssemblyInfo.cs
├── AphidCodeGenerator
├── Aphid.Code.alx
├── Aphid.Tmpl.alx
├── Aphid.alx
├── Aphid.ll
├── AphidBinaryOperatorExpressionRule.cs
├── AphidCodeGenerator.csproj
├── AphidCodeGenerator.csproj.vspscc
├── AphidLexerGenerator.cs
├── AphidObjectGenerator.cs
├── AphidParserGenerator.cs
├── AphidParserRules.cs
├── App.config
├── IAphidCodeObject.cs
├── ParserRules.alx
├── Program.cs
└── Properties
│ └── AssemblyInfo.cs
├── AphidVSShell
├── AphidVSShell.AboutBoxPackage
│ ├── AboutBox.xaml
│ ├── AboutBox.xaml.cs
│ ├── AphidVSShell.AboutBoxPackage.cs
│ ├── AphidVSShell.AboutBoxPackage.csproj
│ ├── AphidVSShell.AboutBoxPackage.csproj.vspscc
│ ├── AphidVSShell.AboutBoxPackage.vsct
│ ├── Guids.cs
│ ├── Key.snk
│ ├── PkgCmdID.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── VSPackage.resx
│ └── source.extension.vsixmanifest
├── AphidVSShell
│ ├── AphidVSShell.Application.pkgdef
│ ├── AphidVSShell.cpp
│ ├── AphidVSShell.exe.config
│ ├── AphidVSShell.exe.manifest
│ ├── AphidVSShell.h
│ ├── AphidVSShell.pkgdef
│ ├── AphidVSShell.pkgundef
│ ├── AphidVSShell.rc
│ ├── AphidVSShell.reg
│ ├── AphidVSShell.vcxproj
│ ├── AphidVSShell.vcxproj.filters
│ ├── AphidVSShell.vcxproj.vspscc
│ ├── AphidVSShell.winprf
│ ├── ApplicationIcon.ico
│ ├── DebuggerProxy.dll
│ ├── DebuggerProxy.dll.manifest
│ ├── Documentation
│ │ ├── Images
│ │ │ └── AppEnv.jpg
│ │ └── ReadMe.htm
│ ├── General.vssettings
│ ├── Resource.h
│ ├── ShellSection.cpp
│ ├── ShellSection.h
│ ├── Splash.bmp
│ ├── VsSDK.props
│ ├── small.ico
│ ├── stdafx.cpp
│ └── stdafx.h
├── AphidVSShellUI
│ ├── AphidVSShellUI.cpp
│ ├── AphidVSShellUI.rc
│ ├── AphidVSShellUI.vcxproj
│ ├── AphidVSShellUI.vcxproj.filters
│ ├── AphidVSShellUI.vcxproj.vspscc
│ ├── ApplicationCommands.vsct
│ └── resource.h
└── ShellExtensionsVSIX
│ ├── Properties
│ └── AssemblyInfo.cs
│ ├── ShellExtensionsVSIX.csproj
│ ├── ShellExtensionsVSIX.csproj.vspscc
│ └── source.extension.vsixmanifest
├── Components.Aphid.Net
├── AphidRequest.cs
├── Components.Aphid.Net.csproj
├── Components.Aphid.Net.csproj.vspscc
├── HttpLibrary.cs
└── Properties
│ └── AssemblyInfo.cs
├── Components.Aphid.Tests.Integration
├── AphidObjectTests.cs
├── AphidTests.cs
├── AssignmentTests.cs
├── Components.Aphid.Tests.Integration.csproj
├── Components.Aphid.Tests.Integration.csproj.vspscc
├── ConditionalTests.cs
├── FunctionTests.cs
├── InitTests.cs
├── ListTests.cs
├── LiteralTests.cs
├── LoopTests.cs
├── NullTests.cs
├── OperatorTests.cs
├── OrderOfOperationsTests.cs
├── Properties
│ └── AssemblyInfo.cs
├── PropertyTests.cs
├── QueryTests.cs
├── ScopeTests.cs
├── StringTests.cs
├── ThisTests.cs
└── packages.config
├── Components.Aphid.VSPackage
├── AphidAuthoringScope.cs
├── AphidLanguageService.cs
├── AphidPackage.cs
├── AphidScanner.cs
├── Components.Aphid.VSPackage.csproj
├── Components.Aphid.VSPackage.csproj.user
├── GlobalSuppressions.cs
├── Guids.cs
├── Key.snk
├── Properties
│ └── AssemblyInfo.cs
├── Resources.Designer.cs
├── Resources.resx
├── Resources
│ └── Package.ico
├── TokenHelper.cs
├── VSPackage.resx
├── source.extension.vsixmanifest
└── todo.txt
├── Components.Aphid
├── App.config
├── Components.Aphid.csproj
├── Components.Aphid.csproj.vspscc
├── Interpreter
│ ├── AphidFunction.cs
│ ├── AphidInteropFunction.cs
│ ├── AphidInteropFunctionAttribute.cs
│ ├── AphidInterpreter.cs
│ ├── AphidLibraryAttribute.cs
│ ├── AphidLoader.cs
│ ├── AphidObject.cs
│ ├── AphidObject.g.cs
│ ├── AphidObjectConverter.cs
│ ├── AphidPropertyAttribute.cs
│ ├── AphidRef.cs
│ ├── AphidScope.cs
│ ├── IAphidBindable.cs
│ ├── InterpreterException.cs
│ ├── OperatorHelper.cs
│ └── ValueHelper.cs
├── Lexer
│ └── AphidLexer.cs
├── Library
│ ├── Conversion.alx
│ ├── Dbg.alx
│ ├── DebugLibrary.cs
│ ├── Env.alx
│ ├── EnvironmentLibrary.cs
│ ├── IO.alx
│ ├── IOLibrary.cs
│ ├── List.alx
│ ├── Query.alx
│ ├── Reflection.alx
│ ├── ReflectionLibrary.cs
│ ├── StandardLibrary.cs
│ ├── Std.alx
│ ├── String.alx
│ ├── Threading.alx
│ └── ThreadingLibrary.cs
├── Parser
│ ├── AphidNode.cs
│ ├── AphidNodeCollection.cs
│ ├── AphidParser.cs
│ ├── AphidParser.g.cs
│ ├── AphidParserException.cs
│ ├── AphidRuntimeException.cs
│ ├── ArrayAccessExpression.cs
│ ├── ArrayExpression.cs
│ ├── BinaryOperatorExpression.cs
│ ├── BooleanExpression.cs
│ ├── BreakExpression.cs
│ ├── CallExpression.cs
│ ├── ControlFlowStatement.cs
│ ├── DynamicMemberExpression.cs
│ ├── ElseExpression.cs
│ ├── Expression.cs
│ ├── ForEachExpression.cs
│ ├── ForExpression.cs
│ ├── FunctionExpression.cs
│ ├── IdentifierExpression.cs
│ ├── IfExpression.cs
│ ├── LoadLibraryExpression.cs
│ ├── LoadScriptExpression.cs
│ ├── MemberExpression.cs
│ ├── NullExpression.cs
│ ├── NumberExpression.cs
│ ├── ObjectExpression.cs
│ ├── PartialFunctionExpression.cs
│ ├── PatternMatchingExpression.cs
│ ├── Statement.cs
│ ├── StringExpression.cs
│ ├── StringParser.cs
│ ├── ThisExpression.cs
│ ├── UnaryOperatorExpression.cs
│ └── ValueExpression.cs
├── Properties
│ └── AssemblyInfo.cs
└── Todo.txt
├── Components.ConsolePlus
├── Cli.cs
├── CliLexerState.cs
├── CliProgressBar.cs
├── Components.ConsolePlus.csproj
├── Components.ConsolePlus.csproj.vspscc
├── DumpMode.cs
└── Properties
│ └── AssemblyInfo.cs
├── Components.Net
├── Components.Net.csproj
├── Components.Net.csproj.vspscc
├── Http
│ ├── ChunkedTransferEncoding.cs
│ ├── ContentDisposition.cs
│ ├── FieldValuePair.cs
│ ├── FormData.cs
│ ├── FormUrlEncoder.cs
│ ├── HttpClient.cs
│ ├── HttpConnection.cs
│ ├── HttpField.cs
│ ├── HttpMessagePart.cs
│ ├── HttpMethod.cs
│ ├── HttpRequest.cs
│ ├── HttpResponse.cs
│ ├── HttpUpload.cs
│ ├── HttpVersion.cs
│ └── MimeType.cs
└── Properties
│ └── AssemblyInfo.cs
├── Components
├── ByteArrayExtension.cs
├── CSharpHelper.cs
├── CodeExpressionExtension.cs
├── CodeHelper.cs
├── CodeMemberMethodExtension.cs
├── CodeMethodReferenceExpressionExtension.cs
├── Components.csproj
├── Components.csproj.vspscc
├── DictionaryExtension.cs
├── DirectoryInfoExtension.cs
├── HashAlgorithmExtension.cs
├── IEnumerableExtension.cs
├── IOHelper.cs
├── IServiceLocator.cs
├── ItemEventArgs.cs
├── PathHelper.cs
├── PluginLoader.cs
├── Properties
│ └── AssemblyInfo.cs
├── ServiceLocator.cs
├── StreamExtension.cs
├── StringEnumerableExtension.cs
├── StringExtension.cs
├── TableBase.cs
├── TypeExtension.cs
├── WebClientHelper.cs
├── WebClientHelperResponse.cs
└── XmlSerializerExtension.cs
├── ComponentsUnitTests
├── ComponentsUnitTests.csproj
├── ComponentsUnitTests.csproj.vspscc
├── Properties
│ └── AssemblyInfo.cs
└── UnitTest1.cs
├── LLex
├── AlxFile.cs
├── BinaryExpression.cs
├── CharExpression.cs
├── GroupExpression.cs
├── LLex.csproj
├── LLex.csproj.vspscc
├── LLexFile.cs
├── LLexNameInfo.cs
├── LexFileMode.cs
├── LexerGenerator.cs
├── LexerState.cs
├── OperatorExpression.cs
├── Program.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── RegexCompiler.cs
├── RegexExpression.cs
├── RegexLexer.cs
├── RegexNode.cs
├── RegexParser.cs
├── Resources
│ ├── AddTokenTemplate.cs
│ ├── CaseTemplate.cs
│ ├── LexicalAnalyzerTemplate.cs
│ ├── RootStateTemplate.cs
│ └── StateTemplate.cs
├── TokenEntry.cs
├── TokenTable.cs
├── app.config
├── php.ll
└── regex.ll
├── LexerTestGenerator
├── App.config
├── LexerTestGenerator.csproj
├── LexerTestGenerator.csproj.vspscc
├── Program.cs
├── Properties
│ └── AssemblyInfo.cs
├── Tokens.cs
└── packages.config
├── MonoBuildScriptGenerator
├── App.config
├── BuildScriptGenerator.cs
├── MonoBuildScriptGenerator.csproj
├── MonoBuildScriptGenerator.csproj.vspscc
├── Program.cs
├── Project.cs
├── Properties
│ └── AssemblyInfo.cs
├── WindowsBuildScriptGenerator.cs
└── phpvh.cmd
├── PhpVH.SelfTest
├── App.config
├── NUnitResults.cs
├── PhpVH.SelfTest.csproj
├── PhpVH.SelfTest.csproj.vspscc
├── Program.cs
├── Properties
│ └── AssemblyInfo.cs
├── SelfTest.cs
├── SelfTestAssembly.cs
├── TestResult.cs
└── Tests.alx
├── PhpVH.Tests.Integration
├── ApiOverrideTester.cs
├── App.config
├── ArrayFunctionTests.cs
├── BasicTests.cs
├── CodeCoverageTests.cs
├── Php
│ ├── ArbitraryRead
│ │ └── ArbitraryRead.php
│ ├── ArbitraryUpload
│ │ └── ArbitraryUpload.php
│ ├── CodeCoverage
│ │ ├── CodeCoverage.php
│ │ ├── CodeCoverage2.php
│ │ ├── CodeCoverage3.php
│ │ └── CodeCoverage4.php
│ ├── CommandInjection
│ │ ├── ArbitraryCommandCookie.php
│ │ ├── ArbitraryCommandGet.php
│ │ ├── ArbitraryCommandGet2.php
│ │ ├── ArbitraryCommandPost.php
│ │ └── ArbitraryCommandPost2.php
│ ├── DynamicInvocation
│ │ ├── DynamicClass.php
│ │ ├── DynamicClass2.php
│ │ ├── DynamicFunction.php
│ │ └── DynamicFunction2.php
│ ├── FalsePositiveCheck.php
│ ├── LocalFileInclusion
│ │ ├── LfiCookie.php
│ │ ├── LfiGet.php
│ │ └── LfiPost.php
│ ├── OpenRedirect
│ │ ├── OpenRedirect.php
│ │ └── OpenRedirect2.php
│ ├── PhpInjection
│ │ ├── ArbitraryPhpCookie.php
│ │ ├── ArbitraryPhpGet.php
│ │ └── ArbitraryPhpPost.php
│ ├── SqlInjection
│ │ ├── SqlInjectionCookie.php
│ │ ├── SqlInjectionGet.php
│ │ ├── SqlInjectionGet2.php
│ │ ├── SqlInjectionGet3.php
│ │ ├── SqlInjectionGet4.php
│ │ ├── SqlInjectionGet5.php
│ │ ├── SqlInjectionPost.php
│ │ ├── SqliteInjectionGet.php
│ │ ├── SqliteInjectionGet2.php
│ │ ├── SqliteInjectionGet3.php
│ │ └── SqliteInjectionGet4.php
│ └── Xss
│ │ ├── XssAttribute.php
│ │ ├── XssBadFilter.php
│ │ ├── XssGet.php
│ │ ├── XssGet2.php
│ │ └── XssPost.php
├── PhpTester.cs
├── PhpVH.Tests.Integration.csproj
├── PhpVH.Tests.Integration.csproj.vspscc
├── PhpVHTester.cs
├── Properties
│ └── AssemblyInfo.cs
├── TestSettings.cs
├── VulnerabilityScannerTests.cs
└── packages.config
├── PhpVH.Tests.Unit
├── CodeCoverage
│ ├── AnnotatorTests.cs
│ └── CodeCoverageCalculatorTests.cs
├── FormScraperTest.cs
├── Html
│ ├── AbsoluteUri.html
│ ├── AbsoluteUri2.html
│ ├── AbsoluteUri3.html
│ ├── Form1.html
│ ├── JavaScriptUri.html
│ ├── MailTo.html
│ ├── RelativeUri.html
│ ├── RelativeUri2.html
│ ├── RelativeUri3.html
│ └── UriLike.html
├── LexicalAnalysis
│ ├── LexerAssert.cs
│ ├── LexerCommentTest.cs
│ ├── LexerHereDocTest.cs
│ ├── LexerTest.Generated.cs
│ ├── LexerTest.cs
│ ├── Pairs.cs
│ ├── TokenAssert.cs
│ ├── TokenPairs.cs
│ └── TokenTest.cs
├── Php
│ └── StaticAnalyzerSuperglobalFields.php
├── PhpVH.Tests.Unit.csproj
├── PhpVH.Tests.Unit.csproj.vspscc
├── Properties
│ └── AssemblyInfo.cs
├── StaticAnalyzerTests.cs
├── UriScraperTest.cs
└── packages.config
├── PhpVH.Tests
├── ExternalResourceTest.cs
├── HtmlTest.cs
├── PhpTest.cs
├── PhpVH.Tests.csproj
├── PhpVH.Tests.csproj.vspscc
└── Properties
│ └── AssemblyInfo.cs
├── PhpVH.sln
├── PhpVH.vssscc
├── PhpVH
├── ApplicationMap.cs
├── ApplicationMapPage.cs
├── BodyChunk.cs
├── CodeAnalysis
│ ├── BooleanExpressionAnalyzer.cs
│ ├── Expression.cs
│ ├── ExpressionAnalyzer.cs
│ ├── ExpressionWalker.cs
│ ├── PageSuperGlobalValueTable.cs
│ ├── SuperGlobalNameValuePair.cs
│ ├── SuperGlobalValueCollector.cs
│ ├── SuperGlobalValueList.cs
│ ├── SuperGlobalValueTable.cs
│ └── SwitchStatementAnalyzer.cs
├── CodeCoverage
│ ├── Annotation.cs
│ ├── AnnotationFileReader.cs
│ ├── AnnotationList.cs
│ ├── AnnotationTable.cs
│ ├── Annotator.cs
│ ├── CodeCoverageCalculator.cs
│ ├── CodeCoverageTable.cs
│ ├── CodePage.cs
│ ├── CodePageTable.cs
│ ├── CoverageCommenter.cs
│ ├── CoveragePageTemplate.html
│ ├── IFileReader.cs
│ ├── IndexTemplate.html
│ └── PluginAnnotationTable.cs
├── DelimiterOptions.cs
├── Delimiters.cs
├── DiscoveryReport.cs
├── Doc
│ └── Readme.txt
├── ExeProbe.cs
├── FileIncludeTable.cs
├── FileTrace.cs
├── FormScraper.cs
├── FormTag.cs
├── FunctionCall.cs
├── Hook.cs
├── HookCollection.cs
├── HtmlTag.cs
├── HttpResponse.cs
├── HttpResponseReader.cs
├── InputTag.cs
├── Jpeg.cs
├── LexicalAnalysis
│ └── Lexer.cs
├── MessageDumper.cs
├── MessageType.cs
├── MimeTypes.cs
├── PageFieldTable.cs
├── PatchHelper.cs
├── Php.cs
├── PhpName.cs
├── PhpParser.cs
├── PhpResource.cs
├── PhpResources
│ ├── Annotation.php
│ ├── DynamicProbes.php
│ ├── PhpApiOverrides.php
│ ├── SuperGlobalOverride.php
│ └── VersionProbe.php
├── PhpVH.csproj
├── PhpVH.csproj.vspscc
├── PhpVersionTester.cs
├── Program.cs
├── Properties
│ └── AssemblyInfo.cs
├── ReportFile.cs
├── ReportWriter.cs
├── RequestBuilder.cs
├── ScanAlert.cs
├── ScanAlertCollection.cs
├── ScanAlertOptions.cs
├── ScanConfig.cs
├── ScanMetrics.cs
├── ScanPlugins
│ ├── ArbitraryPhpScanConfig.cs
│ ├── ArbitraryPhpScanPlugin.cs
│ ├── ArbitraryPhpScanPlugin.xml
│ ├── Command.alx
│ ├── CommandScanConfig.cs
│ ├── CommandScanPlugin.cs
│ ├── ConfigurableScanPluginBase.cs
│ ├── DynamicScanPlugin.cs
│ ├── FileScanMode.cs
│ ├── FileScanPlugin.cs
│ ├── FullPathDisclosureScanPlugin.cs
│ ├── IEnumerableSqlFunctionExtension.cs
│ ├── LocalFileInclusion.alx
│ ├── LocalFileInclusionScanPlugin.cs
│ ├── OpenRedirectScanPlugin.cs
│ ├── PluginConfig.cs
│ ├── ResponseSplittingPlugin.cs
│ ├── ScanPluginBase.cs
│ ├── ScriptableScanPluginBase.cs
│ ├── SqlFunction.cs
│ ├── SqlScanConfig.cs
│ ├── SqlScanPlugin.cs
│ ├── SqlScanPlugin.xml
│ ├── Xss.alx
│ ├── XssScanConfig.cs
│ └── XssScanPlugin.cs
├── ScannerCli.cs
├── ScriptLauncher.cs
├── StaticAnalysis
│ ├── ArbitraryUploadPlugin.cs
│ ├── CommandInjectionPlugin.cs
│ ├── CommandInjectionPlugin2.cs
│ ├── ExtractPlugin.cs
│ ├── InsecureCallPlugin.cs
│ ├── LfiPlugin.cs
│ ├── OpenRedirectPlugin.cs
│ ├── PhpInjectionPlugin.cs
│ ├── SqlInjectionPlugin.cs
│ ├── StaticAnalysisAlert.cs
│ ├── StaticAnalysisEngine.cs
│ ├── StaticAnalysisFileAlertCollection.cs
│ ├── StaticAnalysisFileAlerts.cs
│ ├── StaticAnalysisPlugin.cs
│ └── XssScanPlugin.cs
├── StaticAnalyzer.cs
├── StringParser.cs
├── StringSanitizer.cs
├── SyntaxHighlighter
│ ├── MIT-LICENSE
│ ├── compass
│ │ ├── _theme_template.scss
│ │ ├── config.rb
│ │ ├── shCore.scss
│ │ ├── shCoreDefault.scss
│ │ ├── shCoreDjango.scss
│ │ ├── shCoreEclipse.scss
│ │ ├── shCoreEmacs.scss
│ │ ├── shCoreFadeToGrey.scss
│ │ ├── shCoreMDUltra.scss
│ │ ├── shCoreMidnight.scss
│ │ ├── shCoreRDark.scss
│ │ ├── shThemeDefault.scss
│ │ ├── shThemeDjango.scss
│ │ ├── shThemeEclipse.scss
│ │ ├── shThemeEmacs.scss
│ │ ├── shThemeFadeToGrey.scss
│ │ ├── shThemeMDUltra.scss
│ │ ├── shThemeMidnight.scss
│ │ └── shThemeRDark.scss
│ ├── scripts
│ │ ├── shAutoloader.js
│ │ ├── shBrushAS3.js
│ │ ├── shBrushAppleScript.js
│ │ ├── shBrushBash.js
│ │ ├── shBrushCSharp.js
│ │ ├── shBrushColdFusion.js
│ │ ├── shBrushCpp.js
│ │ ├── shBrushCss.js
│ │ ├── shBrushDelphi.js
│ │ ├── shBrushDiff.js
│ │ ├── shBrushErlang.js
│ │ ├── shBrushGroovy.js
│ │ ├── shBrushJScript.js
│ │ ├── shBrushJava.js
│ │ ├── shBrushJavaFX.js
│ │ ├── shBrushPerl.js
│ │ ├── shBrushPhp.js
│ │ ├── shBrushPlain.js
│ │ ├── shBrushPowerShell.js
│ │ ├── shBrushPython.js
│ │ ├── shBrushRuby.js
│ │ ├── shBrushSass.js
│ │ ├── shBrushScala.js
│ │ ├── shBrushSql.js
│ │ ├── shBrushVb.js
│ │ ├── shBrushXml.js
│ │ ├── shCore.js
│ │ └── shLegacy.js
│ ├── src
│ │ ├── shAutoloader.js
│ │ ├── shCore.js
│ │ └── shLegacy.js
│ └── styles
│ │ ├── shCore.css
│ │ ├── shCoreDefault.css
│ │ ├── shCoreDjango.css
│ │ ├── shCoreEclipse.css
│ │ ├── shCoreEmacs.css
│ │ ├── shCoreFadeToGrey.css
│ │ ├── shCoreMDUltra.css
│ │ ├── shCoreMidnight.css
│ │ ├── shCoreRDark.css
│ │ ├── shThemeDefault.css
│ │ ├── shThemeDjango.css
│ │ ├── shThemeEclipse.css
│ │ ├── shThemeEmacs.css
│ │ ├── shThemeFadeToGrey.css
│ │ ├── shThemeMDUltra.css
│ │ ├── shThemeMidnight.css
│ │ └── shThemeRDark.css
├── Todo.txt
├── TraceTable.cs
├── TracedFunctionCall.cs
├── UriScraper.cs
├── UriScraperModule.cs
└── app.config
├── PhpVHGui
├── App.config
├── App.xaml
├── App.xaml.cs
├── Content
│ └── Images
│ │ └── PHPVHGuide-1.png
├── DialogWindow.xaml
├── DialogWindow.xaml.cs
├── Guide.xaml
├── Guide.xaml.cs
├── PHP Vulnerability Hunter Guide.htm
├── PhpVHGui.csproj
├── PhpVHGui.csproj.vspscc
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── Window1.xaml
└── Window1.xaml.cs
├── PhpVHProbe
├── PhpVHProbe.csproj
├── PhpVHProbe.csproj.vspscc
├── Program.cs
├── Properties
│ └── AssemblyInfo.cs
└── app.config
├── PhpVHReportViewer
├── App.xaml
├── App.xaml.cs
├── Models
│ ├── CommandWireup.cs
│ └── DependencyObjectExtension.cs
├── PhpVHReportViewer.csproj
├── PhpVHReportViewer.csproj.vspscc
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── ViewModels
│ ├── AlertViewModel.cs
│ ├── BaseViewModel.cs
│ ├── ItemViewModel.cs
│ └── ScanViewModel.cs
├── Views
│ ├── DynamicAnalysisDetailsControl.xaml
│ ├── DynamicAnalysisDetailsControl.xaml.cs
│ ├── DynamicAnalysisVulnerabilityControl.xaml
│ ├── DynamicAnalysisVulnerabilityControl.xaml.cs
│ ├── DynamicAnalysisVulnerabilityViewerControl.xaml
│ ├── DynamicAnalysisVulnerabilityViewerControl.xaml.cs
│ ├── StaticAnalysisResultsControl.xaml
│ └── StaticAnalysisResultsControl.xaml.cs
├── Window1.xaml
├── Window1.xaml.cs
└── app.config
├── ReleasePackager
├── App.config
├── Cleanup.cs
├── FileSystemInfoHelper.cs
├── MSBuild.cs
├── PhpVH.alx
├── Program.cs
├── Properties
│ └── AssemblyInfo.cs
├── Release.cs
├── ReleasePackager.csproj
├── ReleasePackager.csproj.vspscc
└── ReleaseProject.cs
└── build.cmd
/Aphid/Aphid.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/Aphid/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Aphid/HelloWorld.alx:
--------------------------------------------------------------------------------
1 | #'Std';
2 | print('hello world');
--------------------------------------------------------------------------------
/AphidCodeGenerator/AphidBinaryOperatorExpressionRule.cs:
--------------------------------------------------------------------------------
1 | using Components.Aphid.Interpreter;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace AphidCodeGenerator
9 | {
10 | public class AphidBinaryOperatorExpressionRule
11 | {
12 | [AphidProperty("name")]
13 | public string Name { get; set; }
14 |
15 | [AphidProperty("operators")]
16 | public string[] Operators { get; set; }
17 |
18 | [AphidProperty("operand")]
19 | public string Operand { get; set; }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/AphidCodeGenerator/AphidCodeGenerator.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/AphidCodeGenerator/AphidLexerGenerator.cs:
--------------------------------------------------------------------------------
1 | using Components;
2 | using System;
3 | using System.CodeDom;
4 | using System.Collections.Generic;
5 | using System.IO;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 |
10 | namespace AphidCodeGenerator
11 | {
12 | class AphidLexerGenerator : IAphidCodeObject
13 | {
14 | public string CodeFile
15 | {
16 | get { { return @"Lexer\AphidLexer.cs"; } }
17 | }
18 |
19 | public System.CodeDom.CodeObject CreateCodeObject()
20 | {
21 | var llex = PathHelper.GetExecutingPath("llex.exe");
22 | var tmpFile = Path.GetTempFileName();
23 |
24 | AppDomain.CurrentDomain.ExecuteAssembly(
25 | llex,
26 | new[]
27 | {
28 | "Aphid.alx",
29 | tmpFile
30 | });
31 |
32 | var snippet = new CodeSnippetCompileUnit(File.ReadAllText(tmpFile));
33 | File.Delete(tmpFile);
34 | return snippet;
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/AphidCodeGenerator/AphidParserRules.cs:
--------------------------------------------------------------------------------
1 | using Components.Aphid.Interpreter;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace AphidCodeGenerator
9 | {
10 | public class AphidParserRules
11 | {
12 | [AphidProperty("binOpExps")]
13 | public AphidBinaryOperatorExpressionRule[] BinaryOperatorExpressions { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/AphidCodeGenerator/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/AphidCodeGenerator/IAphidCodeObject.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.CodeDom;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace AphidCodeGenerator
9 | {
10 | public interface IAphidCodeObject
11 | {
12 | string CodeFile { get; }
13 | CodeObject CreateCodeObject();
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/AphidCodeGenerator/Program.cs:
--------------------------------------------------------------------------------
1 | using Components;
2 | using System.IO;
3 | using System.Linq;
4 |
5 | namespace AphidCodeGenerator
6 | {
7 | class Program
8 | {
9 | static void Main(string[] args)
10 | {
11 | new PluginLoader()
12 | .Load()
13 | .Select(x => new
14 | {
15 | File = x.CodeFile,
16 | Code = CSharpHelper.GenerateCode(x.CreateCodeObject())
17 | })
18 | .Iter(x => File.WriteAllText(Path.Combine(args[0], x.File), x.Code));
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/AphidVSShell/AphidVSShell.AboutBoxPackage/AphidVSShell.AboutBoxPackage.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/AphidVSShell/AphidVSShell.AboutBoxPackage/Guids.cs:
--------------------------------------------------------------------------------
1 | // Guids.cs
2 | // MUST match guids.h
3 | using System;
4 |
5 | namespace AphidVSShell.AboutBoxPackage
6 | {
7 | static class GuidList
8 | {
9 | public const string guidAboutBoxPackagePkgString = "8f0310b2-1205-40d2-b636-89f030e375b5";
10 | public const string guidAboutBoxPackageCmdSetString = "9583b111-0359-43db-bd1e-8f9c4b87c87e";
11 |
12 | public static readonly Guid guidAboutBoxPackageCmdSet = new Guid(guidAboutBoxPackageCmdSetString);
13 | };
14 | }
--------------------------------------------------------------------------------
/AphidVSShell/AphidVSShell.AboutBoxPackage/Key.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/robocoder/phpvh/4bf4d4a2a3dcf0d5f0a446c604a9e696ea2c65f5/AphidVSShell/AphidVSShell.AboutBoxPackage/Key.snk
--------------------------------------------------------------------------------
/AphidVSShell/AphidVSShell.AboutBoxPackage/PkgCmdID.cs:
--------------------------------------------------------------------------------
1 | // PkgCmdID.cs
2 | // MUST match PkgCmdID.h
3 | using System;
4 |
5 | namespace AphidVSShell.AboutBoxPackage
6 | {
7 | static class PkgCmdIDList
8 | {
9 | public const uint cmdidHelpAbout = 0x100;
10 |
11 |
12 | };
13 | }
--------------------------------------------------------------------------------
/AphidVSShell/AphidVSShell.AboutBoxPackage/source.extension.vsixmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | About Box Package
6 | Information about AphidVSShell About Box package
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/AphidVSShell/AphidVSShell/AphidVSShell.Application.pkgdef:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/robocoder/phpvh/4bf4d4a2a3dcf0d5f0a446c604a9e696ea2c65f5/AphidVSShell/AphidVSShell/AphidVSShell.Application.pkgdef
--------------------------------------------------------------------------------
/AphidVSShell/AphidVSShell/AphidVSShell.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/robocoder/phpvh/4bf4d4a2a3dcf0d5f0a446c604a9e696ea2c65f5/AphidVSShell/AphidVSShell/AphidVSShell.cpp
--------------------------------------------------------------------------------
/AphidVSShell/AphidVSShell/AphidVSShell.exe.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 | true
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/AphidVSShell/AphidVSShell/AphidVSShell.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/robocoder/phpvh/4bf4d4a2a3dcf0d5f0a446c604a9e696ea2c65f5/AphidVSShell/AphidVSShell/AphidVSShell.h
--------------------------------------------------------------------------------
/AphidVSShell/AphidVSShell/AphidVSShell.pkgdef:
--------------------------------------------------------------------------------
1 | [$Initialization$]
2 | "ApplicationExtensionsFolder" = "$RootFolder$\Extensions"
3 | "PkgDefSearchPath" = "$ShellFolder$\Common7\IDE\ShellExtensions; \
4 | $ShellFolder$\Common7\IDE\CommonExtensions\Platform; \
5 | $ShellFolder$\Common7\IDE\CommonExtensions\Microsoft\Editor; \
6 | $ShellFolder$\Common7\IDE\CommonExtensions\Microsoft\TemplateProviders; \
7 | $ShellFolder$\Common7\IDE\CommonExtensions\Microsoft\Diff; \
8 | $ShellFolder$\Common7\IDE\CommonExtensions\Microsoft\ProjectWizards; \
9 | $ShellFolder$\Common7\IDE\CommonExtensions\Microsoft\Language\CallHierarchy; \
10 | $ApplicationExtensionsFolder$"
11 | "RegistryRoot" = "Software\My Company\AphidVSShell\1.0"
12 |
--------------------------------------------------------------------------------
/AphidVSShell/AphidVSShell/AphidVSShell.reg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/robocoder/phpvh/4bf4d4a2a3dcf0d5f0a446c604a9e696ea2c65f5/AphidVSShell/AphidVSShell/AphidVSShell.reg
--------------------------------------------------------------------------------
/AphidVSShell/AphidVSShell/AphidVSShell.vcxproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/AphidVSShell/AphidVSShell/ApplicationIcon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/robocoder/phpvh/4bf4d4a2a3dcf0d5f0a446c604a9e696ea2c65f5/AphidVSShell/AphidVSShell/ApplicationIcon.ico
--------------------------------------------------------------------------------
/AphidVSShell/AphidVSShell/DebuggerProxy.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/robocoder/phpvh/4bf4d4a2a3dcf0d5f0a446c604a9e696ea2c65f5/AphidVSShell/AphidVSShell/DebuggerProxy.dll
--------------------------------------------------------------------------------
/AphidVSShell/AphidVSShell/Documentation/Images/AppEnv.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/robocoder/phpvh/4bf4d4a2a3dcf0d5f0a446c604a9e696ea2c65f5/AphidVSShell/AphidVSShell/Documentation/Images/AppEnv.jpg
--------------------------------------------------------------------------------
/AphidVSShell/AphidVSShell/General.vssettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | false
11 | false
12 | true
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/AphidVSShell/AphidVSShell/Resource.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/robocoder/phpvh/4bf4d4a2a3dcf0d5f0a446c604a9e696ea2c65f5/AphidVSShell/AphidVSShell/Resource.h
--------------------------------------------------------------------------------
/AphidVSShell/AphidVSShell/ShellSection.cpp:
--------------------------------------------------------------------------------
1 | // ShellSection.cpp
2 | // Implementation file for functions used to ensure Isolated Shell executables
3 | // define a section used to mark them as such.
4 |
5 | #include "stdafx.h"
6 | #include "ShellSection.h"
7 |
8 | // "vsshell" section is used to mark the executable as being based on the Visual Studio Shell.
9 | #pragma section("vsshell", read, write)
10 | __declspec(allocate("vsshell"))
11 | int iVSShellSectionField = 0;
12 |
13 | // The objective of this function is to ensure the field above is used in code.
14 | // Otherwise, the compiler could optimize the section away in release builds.
15 | void InitializeVSShellSection()
16 | {
17 | iVSShellSectionField = 1;
18 | }
19 |
--------------------------------------------------------------------------------
/AphidVSShell/AphidVSShell/ShellSection.h:
--------------------------------------------------------------------------------
1 | // ShellSection.h
2 | // Include file for functions used to ensure Isolated Shell executables
3 | // define a section used to mark them as such.
4 |
5 | #pragma once
6 |
7 | void InitializeVSShellSection();
8 |
9 |
--------------------------------------------------------------------------------
/AphidVSShell/AphidVSShell/Splash.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/robocoder/phpvh/4bf4d4a2a3dcf0d5f0a446c604a9e696ea2c65f5/AphidVSShell/AphidVSShell/Splash.bmp
--------------------------------------------------------------------------------
/AphidVSShell/AphidVSShell/VsSDK.props:
--------------------------------------------------------------------------------
1 |
2 |
3 | Mixed
4 |
5 |
--------------------------------------------------------------------------------
/AphidVSShell/AphidVSShell/small.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/robocoder/phpvh/4bf4d4a2a3dcf0d5f0a446c604a9e696ea2c65f5/AphidVSShell/AphidVSShell/small.ico
--------------------------------------------------------------------------------
/AphidVSShell/AphidVSShell/stdafx.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/robocoder/phpvh/4bf4d4a2a3dcf0d5f0a446c604a9e696ea2c65f5/AphidVSShell/AphidVSShell/stdafx.cpp
--------------------------------------------------------------------------------
/AphidVSShell/AphidVSShell/stdafx.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/robocoder/phpvh/4bf4d4a2a3dcf0d5f0a446c604a9e696ea2c65f5/AphidVSShell/AphidVSShell/stdafx.h
--------------------------------------------------------------------------------
/AphidVSShell/AphidVSShellUI/AphidVSShellUI.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/robocoder/phpvh/4bf4d4a2a3dcf0d5f0a446c604a9e696ea2c65f5/AphidVSShell/AphidVSShellUI/AphidVSShellUI.cpp
--------------------------------------------------------------------------------
/AphidVSShell/AphidVSShellUI/AphidVSShellUI.vcxproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/AphidVSShell/AphidVSShellUI/resource.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/robocoder/phpvh/4bf4d4a2a3dcf0d5f0a446c604a9e696ea2c65f5/AphidVSShell/AphidVSShellUI/resource.h
--------------------------------------------------------------------------------
/AphidVSShell/ShellExtensionsVSIX/ShellExtensionsVSIX.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/AphidVSShell/ShellExtensionsVSIX/source.extension.vsixmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Shell VSIX manifest
6 | Core extensions for AphidVSShell
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Components.Aphid.Net/Components.Aphid.Net.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/Components.Aphid.Tests.Integration/AssignmentTests.cs:
--------------------------------------------------------------------------------
1 | using NUnit.Framework;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace Components.Aphid.Tests.Integration
9 | {
10 | [TestFixture(Category = "AphidAssignment")]
11 | public class AssignmentTests : AphidTests
12 | {
13 | [Test]
14 | public void AssignmentTest()
15 | {
16 | AssertTrue("x = 1; ret x == 1;");
17 | }
18 |
19 | [Test]
20 | public void AssignmentTest2()
21 | {
22 | AssertTrue("x = 1; y = x; y = 9; ret x == 1 && y == 9;");
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Components.Aphid.Tests.Integration/Components.Aphid.Tests.Integration.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/Components.Aphid.Tests.Integration/FunctionTests.cs:
--------------------------------------------------------------------------------
1 | using NUnit.Framework;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace Components.Aphid.Tests.Integration
9 | {
10 | [TestFixture(Category = "AphidFunction")]
11 | public class FunctionTests : AphidTests
12 | {
13 | [Test]
14 | public void FunctionTest()
15 | {
16 | Assert9("sqr=@(x){ret x*x;}; ret sqr(3);");
17 | }
18 |
19 | [Test]
20 | public void SingleLineFunctionTest()
21 | {
22 | AssertFoo("x = @()'foo'; ret x();");
23 | }
24 |
25 | [Test]
26 | public void SingleLineFunctionTest2()
27 | {
28 | Assert9("sqr=@(x)x*x; ret sqr(3);");
29 | }
30 |
31 | [Test]
32 | public void HigherOrderFunctionTest()
33 | {
34 | AssertFoo("call=@(x)x(); test=@()'foo'; ret call(test);");
35 | }
36 |
37 | [Test]
38 | public void HigherOrderFunctionTest2()
39 | {
40 | Assert9("add=@(x)@(y)x+y; addFour=add(4); ret addFour(5);");
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/Components.Aphid.Tests.Integration/InitTests.cs:
--------------------------------------------------------------------------------
1 | using NUnit.Framework;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace Components.Aphid.Tests.Integration
9 | {
10 | [TestFixture(Category = "AphidTypeInit")]
11 | public class TypeInitTests : AphidTests
12 | {
13 | protected override bool LoadStd { get { return true; } }
14 |
15 | protected override bool LoadReflection { get { return true; } }
16 |
17 | [Test]
18 | public void LengthTest1()
19 | {
20 | Assert9("a={b:'aaaaaaaaa'}; x={y:'a'}; x.{'y'}=a.{'b'}; ret x.y.length();");
21 | }
22 |
23 | [Test]
24 | public void LengthTest2()
25 | {
26 | Assert9("x='aaaaaaaaa'; y='a'; y=this.{'x'}; ret y.length();");
27 | }
28 |
29 | [Test]
30 | public void LengthTest3()
31 | {
32 | Assert9("this.x='aaaaaaaaa'; this.y='a'; y=this.{'x'}; ret y.length();");
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/Components.Aphid.Tests.Integration/LiteralTests.cs:
--------------------------------------------------------------------------------
1 | using NUnit.Framework;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace Components.Aphid.Tests.Integration
9 | {
10 | [TestFixture(Category = "AphidLiteral")]
11 | public class LiteralTests : AphidTests
12 | {
13 | [Test]
14 | public void NumberTest()
15 | {
16 | Assert9("ret 9;");
17 | }
18 |
19 | [Test]
20 | public void HexNumberTest()
21 | {
22 | Assert9("ret 0x9;");
23 | }
24 |
25 | [Test]
26 | public void HexNumberTest2()
27 | {
28 | Assert9("ret 0xA - 0x1;");
29 | }
30 |
31 | [Test]
32 | public void HexNumberTest3()
33 | {
34 | Assert9("ret 0xf - 0x6;");
35 | }
36 |
37 | [Test]
38 | public void HexNumberTest4()
39 | {
40 | AssertEquals(0, "ret 0x0;");
41 | }
42 |
43 | [Test]
44 | public void StringTest()
45 | {
46 | AssertFoo("ret 'foo';");
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/Components.Aphid.Tests.Integration/LoopTests.cs:
--------------------------------------------------------------------------------
1 | using NUnit.Framework;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace Components.Aphid.Tests.Integration
9 | {
10 | [TestFixture(Category = "AphidLoop")]
11 | public class LoopTests : AphidTests
12 | {
13 | [Test]
14 | public void ForTest()
15 | {
16 | AssertFoo("c=['f','o','o']; s=''; for(x in c){s = s + x;} ret s;");
17 | }
18 |
19 | [Test]
20 | public void ForTest2()
21 | {
22 | AssertFoo("c=['f','o','o']; s=''; for(x in c)s = s + x; ret s;");
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Components.Aphid.Tests.Integration/OperatorTests.cs:
--------------------------------------------------------------------------------
1 | using NUnit.Framework;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace Components.Aphid.Tests.Integration
9 | {
10 | [TestFixture(Category = "AphidOperator")]
11 | public class OperatorTests : AphidTests
12 | {
13 | [Test]
14 | public void AssignmentTest()
15 | {
16 | AssertFoo("x='foo'; ret x;");
17 | }
18 |
19 | [Test]
20 | public void AssignmentTest2()
21 | {
22 | AssertFoo("x='bar'; x='foo'; ret x;");
23 | }
24 |
25 | [Test]
26 | public void StringConcatTest()
27 | {
28 | AssertFoo("ret 'fo'+'o';");
29 | }
30 |
31 | [Test]
32 | public void AdditionTest()
33 | {
34 | Assert9("ret 2+7;");
35 | }
36 |
37 | [Test]
38 | public void SubtractionTest()
39 | {
40 | Assert9("ret 11-2;");
41 | }
42 |
43 | [Test]
44 | public void MultiplicationTest()
45 | {
46 | AssertEquals(20m, "ret 10*2;");
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/Components.Aphid.Tests.Integration/PropertyTests.cs:
--------------------------------------------------------------------------------
1 | using NUnit.Framework;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace Components.Aphid.Tests.Integration
9 | {
10 | [TestFixture(Category = "AphidProperties")]
11 | public class PropertyTests : AphidTests
12 | {
13 | [Test]
14 | public void PropertyGetTest()
15 | {
16 | AssertFoo("x={y:'foo'}; ret x.y;");
17 | }
18 |
19 | [Test]
20 | public void PropertyGetTest2()
21 | {
22 | AssertFoo("x={y:{z:{a:{b:{c:'foo'}}}}}; ret x.y.z.a.b.c;");
23 | }
24 |
25 | [Test]
26 | public void PropertySetTest()
27 | {
28 | AssertFoo("x={}; x.y='foo'; ret x.y;");
29 | }
30 |
31 | [Test]
32 | public void PropertySetTest2()
33 | {
34 | AssertFoo("x={y:'bar'}; x.y='foo'; ret x.y;");
35 | }
36 |
37 | [Test]
38 | public void PropertySetTest3()
39 | {
40 | AssertFoo("x={y:{z:{}}}; x.y.z.a='foo'; ret x.y.z.a;");
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/Components.Aphid.Tests.Integration/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Components.Aphid.VSPackage/Components.Aphid.VSPackage.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Program
5 | C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe
6 | /rootsuffix Exp
7 |
8 |
9 | Program
10 | C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe
11 | /rootsuffix Exp
12 |
13 |
--------------------------------------------------------------------------------
/Components.Aphid.VSPackage/GlobalSuppressions.cs:
--------------------------------------------------------------------------------
1 | // This file is used by Code Analysis to maintain SuppressMessage
2 | // attributes that are applied to this project. Project-level
3 | // suppressions either have no target or are given a specific target
4 | // and scoped to a namespace, type, member, etc.
5 | //
6 | // To add a suppression to this file, right-click the message in the
7 | // Error List, point to "Suppress Message(s)", and click "In Project
8 | // Suppression File". You do not need to add suppressions to this
9 | // file manually.
10 |
11 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1017:MarkAssembliesWithComVisible")]
12 |
--------------------------------------------------------------------------------
/Components.Aphid.VSPackage/Guids.cs:
--------------------------------------------------------------------------------
1 | // Guids.cs
2 | // MUST match guids.h
3 | using System;
4 |
5 | namespace Components.Aphid.VSPackage
6 | {
7 | static class GuidList
8 | {
9 | public const string guidAphidPackagePkgString = "fe11c5b2-f1f0-49a9-bddc-f2c829aa4922";
10 | public const string guidAphidPackageCmdSetString = "ff925d28-a192-4801-ab9b-dbca5eb905b7";
11 |
12 | public static readonly Guid guidAphidPackageCmdSet = new Guid(guidAphidPackageCmdSetString);
13 | };
14 | }
--------------------------------------------------------------------------------
/Components.Aphid.VSPackage/Key.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/robocoder/phpvh/4bf4d4a2a3dcf0d5f0a446c604a9e696ea2c65f5/Components.Aphid.VSPackage/Key.snk
--------------------------------------------------------------------------------
/Components.Aphid.VSPackage/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 | using System.Resources;
4 | using System.Runtime.CompilerServices;
5 | using System.Runtime.InteropServices;
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | [assembly: AssemblyTitle("AphidPackage")]
11 | [assembly: AssemblyDescription("")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("Company")]
14 | [assembly: AssemblyProduct("AphidPackage")]
15 | [assembly: AssemblyCopyright("")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 | [assembly: ComVisible(false)]
19 | [assembly: CLSCompliant(false)]
20 | [assembly: NeutralResourcesLanguage("en-US")]
21 |
22 | // Version information for an assembly consists of the following four values:
23 | //
24 | // Major Version
25 | // Minor Version
26 | // Build Number
27 | // Revision
28 | //
29 | // You can specify all the values or you can default the Revision and Build Numbers
30 | // by using the '*' as shown below:
31 |
32 | [assembly: AssemblyVersion("1.0.0.0")]
33 | [assembly: AssemblyFileVersion("1.0.0.0")]
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/Components.Aphid.VSPackage/Resources/Package.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/robocoder/phpvh/4bf4d4a2a3dcf0d5f0a446c604a9e696ea2c65f5/Components.Aphid.VSPackage/Resources/Package.ico
--------------------------------------------------------------------------------
/Components.Aphid.VSPackage/source.extension.vsixmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Aphid
6 | Information about my package
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Components.Aphid.VSPackage/todo.txt:
--------------------------------------------------------------------------------
1 | Create isolated shell
--------------------------------------------------------------------------------
/Components.Aphid/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Components.Aphid/Components.Aphid.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/Components.Aphid/Interpreter/AphidFunction.cs:
--------------------------------------------------------------------------------
1 | using Components.Aphid.Parser;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace Components.Aphid.Interpreter
9 | {
10 | public class AphidFunction
11 | {
12 | public string[] Args { get; set; }
13 |
14 | public List Body { get; set; }
15 |
16 | public AphidObject ParentScope { get; set; }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Components.Aphid/Interpreter/AphidInteropFunctionAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Components.Aphid.Interpreter
4 | {
5 | [AttributeUsage(AttributeTargets.Method)]
6 | public class AphidInteropFunctionAttribute : Attribute
7 | {
8 | public string Name { get; set; }
9 |
10 | public bool PassInterpreter { get; set; }
11 |
12 | public bool UnwrapParameters { get; set; }
13 |
14 | public AphidInteropFunctionAttribute (string name)
15 | {
16 | UnwrapParameters = true;
17 | Name = name;
18 | }
19 | }
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/Components.Aphid/Interpreter/AphidLibraryAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Components.Aphid.Interpreter
4 | {
5 | [AttributeUsage(AttributeTargets.Class)]
6 | public class AphidLibraryAttribute : Attribute
7 | {
8 | public string Name { get; set; }
9 |
10 | public AphidLibraryAttribute (string name)
11 | {
12 | Name = name;
13 | }
14 | }
15 | }
16 |
17 |
--------------------------------------------------------------------------------
/Components.Aphid/Interpreter/AphidObjectConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Components.Aphid.Interpreter
7 | {
8 | public static class AphidObjectConverter
9 | {
10 | public static string[] ToStringArray(AphidObject obj)
11 | {
12 | return (obj.Value as List).Select(x => (string)x.Value).ToArray();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Components.Aphid/Interpreter/AphidPropertyAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Components.Aphid.Interpreter
7 | {
8 | [AttributeUsage(AttributeTargets.Property)]
9 | public class AphidPropertyAttribute : Attribute
10 | {
11 | public string Name { get; set; }
12 |
13 | public AphidPropertyAttribute()
14 | {
15 | }
16 |
17 | public AphidPropertyAttribute(string name)
18 | : base()
19 | {
20 | Name = name;
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Components.Aphid/Interpreter/AphidRef.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Components.Aphid.Interpreter
8 | {
9 | public class AphidRef
10 | {
11 | public string Name { get; set; }
12 |
13 | public AphidObject Object { get; set; }
14 |
15 | public AphidObject Get()
16 | {
17 | return Object[Name];
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Components.Aphid/Interpreter/AphidScope.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Components.Aphid.Interpreter
4 | {
5 | public class AphidScope
6 | {
7 | public AphidScope Parent { get; set; }
8 |
9 | public AphidObject Variables { get; set; }
10 |
11 | public AphidScope ()
12 | {
13 | }
14 |
15 | public AphidScope(AphidObject variables)
16 | {
17 | Variables = variables;
18 | }
19 |
20 | public AphidScope(AphidObject variables, AphidScope parent)
21 | : this(variables)
22 | {
23 | Parent = parent;
24 | }
25 | }
26 | }
27 |
28 |
--------------------------------------------------------------------------------
/Components.Aphid/Interpreter/IAphidBindable.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Components.Aphid.Interpreter
7 | {
8 | public interface IAphidBindable
9 | {
10 | void OnBinding(AphidObject source);
11 | void OnBound(AphidObject source);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Components.Aphid/Interpreter/InterpreterException.cs:
--------------------------------------------------------------------------------
1 | using Components.Aphid.Lexer;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace Components.Aphid.Interpreter
8 | {
9 | public class InterpreterException : Exception
10 | {
11 | public string Message { get; set; }
12 |
13 | public AphidToken Token { get; set; }
14 |
15 | public InterpreterException()
16 | {
17 | }
18 |
19 | public InterpreterException(string message, AphidToken token)
20 | {
21 | Message = message;
22 | Token = token;
23 | }
24 |
25 | public override string ToString()
26 | {
27 | return string.Format("{0} at {1}", Message, Token);
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Components.Aphid/Interpreter/ValueHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Components.Aphid.Interpreter
7 | {
8 | public static class ValueHelper
9 | {
10 | public static object Unwrap(object obj)
11 | {
12 | AphidObject aphidObj;
13 |
14 | return (aphidObj = obj as AphidObject) != null ? aphidObj.Value : obj;
15 | }
16 |
17 | public static AphidObject Wrap(object obj)
18 | {
19 | AphidObject aphidObj;
20 |
21 | return (aphidObj = obj as AphidObject) != null ? aphidObj : new AphidObject(obj);
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Components.Aphid/Library/Conversion.alx:
--------------------------------------------------------------------------------
1 | strToHex = @(x) x.chars().map(hexb).addAll();
2 |
3 | urlEnc = @(x) x.chars().map(@(y) '%' + hexb(y)).addAll();
--------------------------------------------------------------------------------
/Components.Aphid/Library/Dbg.alx:
--------------------------------------------------------------------------------
1 | ##'Components.Aphid.Library.DebugLibrary';
2 |
3 | dbg.enabled = false;
4 | dbg.enable = @() dbg.enabled = true;
5 | dbg.disable = @() dbg.enabled = false;
6 |
7 | dbg.code = @(f) {
8 | if (dbg.enabled) f();
9 | };
--------------------------------------------------------------------------------
/Components.Aphid/Library/DebugLibrary.cs:
--------------------------------------------------------------------------------
1 | using Components.Aphid.Interpreter;
2 | using System;
3 | using System.Linq;
4 | using System.IO;
5 | using System.Collections.Generic;
6 | using System.Diagnostics;
7 |
8 | namespace Components.Aphid.Library
9 | {
10 | [AphidLibraryAttribute("dbg.breakpoint")]
11 | public class DebugLibrary
12 | {
13 | [AphidInteropFunction("dbg.breakpoint")]
14 | private static void DebuggerBreak()
15 | {
16 | Debugger.Break();
17 | }
18 | }
19 | }
20 |
21 |
--------------------------------------------------------------------------------
/Components.Aphid/Library/Env.alx:
--------------------------------------------------------------------------------
1 | ##'Components.Aphid.Library.EnvironmentLibrary';
2 |
3 | createDefaultArgObj = @(argConfig) {
4 | argObj = {};
5 | argConfig.iter(@(x) {
6 | if (x.default?) {
7 | argObj.{x.arg} = x.default;
8 | } else if (!(x.hasValue?) || !x.hasValue) {
9 | argObj.{x.arg} = false;
10 | }
11 | });
12 | ret argObj;
13 | };
14 |
15 | env.readArgs = @(argConfig) {
16 | argObj = createDefaultArgObj(argConfig);
17 |
18 | args = env.args().skip(1);
19 |
20 | for (i = 0; i < args.count(); i++) {
21 | a = args[i];
22 |
23 | for (j = 0; j < argConfig.count(); j++) {
24 | ac = argConfig[j];
25 | if ('-' + ac.arg == a) {
26 | v;
27 | if (ac.hasValue? && ac.hasValue) {
28 | i++;
29 | v = args[i];
30 | } else {
31 | v = true;
32 | }
33 |
34 | //reflection.mix(v, argObj.{ac.arg});
35 | //__initString(v);
36 | argObj.{ac.arg} = v;
37 | }
38 | }
39 | }
40 |
41 | ret argObj;
42 | };
43 |
44 | env.exec = @(exe, args, opts) env.execInternal(exe, args, opts);
--------------------------------------------------------------------------------
/Components.Aphid/Library/IO.alx:
--------------------------------------------------------------------------------
1 | ##'Components.Aphid.Library.IOLibrary';
2 |
3 | getFsos = @(f, dir, opt) {
4 | filter = '*';
5 | recurse = false;
6 |
7 | if (opt?) {
8 | if (opt.filter?) filter = opt.filter;
9 | if (opt.recurse?) recurse = opt.recurse;
10 | }
11 |
12 | ret f(dir, filter, recurse);
13 | };
14 |
15 | io.dir.getFiles = @getFsos(io.dir.getFilesInternal);
16 | io.dir.getDirs = @getFsos(io.dir.getDirsInternal);
--------------------------------------------------------------------------------
/Components.Aphid/Library/Reflection.alx:
--------------------------------------------------------------------------------
1 | ##'Components.Aphid.Library.ReflectionLibrary';
2 | #'Dbg';
3 |
4 | reflection.mix = @(src, dst) {
5 | for (m in reflection.members(src)) {
6 | dst.{m} = src.{m};
7 | reflection.mix(src.{m}, dst.{m});
8 | }
9 | };
10 |
11 | reflection.getMember = @(obj, path) {
12 | val = obj;
13 | parts = path.split('.');
14 |
15 | for (p in parts) {
16 | val = val.{p};
17 | }
18 |
19 | ret val;
20 | };
--------------------------------------------------------------------------------
/Components.Aphid/Library/ReflectionLibrary.cs:
--------------------------------------------------------------------------------
1 | using Components.Aphid.Interpreter;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace Components.Aphid.Library
8 | {
9 | [AphidLibrary("reflection")]
10 | public class ReflectionLibrary
11 | {
12 | [AphidInteropFunction("reflection.members", UnwrapParameters = false)]
13 | public static List Members(AphidObject obj)
14 | {
15 | return obj.Select(x => new AphidObject(x.Key)).ToList();
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Components.Aphid/Library/Std.alx:
--------------------------------------------------------------------------------
1 | ##'Components.Aphid.Library.StandardLibrary';
2 | #'String';
3 | #'List';
4 | #'Conversion';
5 |
6 |
--------------------------------------------------------------------------------
/Components.Aphid/Library/String.alx:
--------------------------------------------------------------------------------
1 | __initString = @(s) {
2 | s.chars = @() __string.getChars(s);
3 | s.split = @(separator) __string.split(s, separator);
4 | s.isMatch = @(pattern) __string.isMatch(s, pattern);
5 | s.length = @() __string.length(s);
6 | s.remove = @(index) __string.remove(s, index);
7 | s.substring = @(index, length) __string.substring(s, index, length);
8 | s.startsWith = @(value) __string.startsWith(s, value);
9 | s.endsWith = @(value) __string.endsWith(s, value);
10 | };
--------------------------------------------------------------------------------
/Components.Aphid/Library/Threading.alx:
--------------------------------------------------------------------------------
1 | ##'Components.Aphid.Library.ThreadingLibrary';
--------------------------------------------------------------------------------
/Components.Aphid/Parser/AphidNode.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Components.Aphid.Parser
4 | {
5 | public abstract class AphidNode
6 | {
7 |
8 | }
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/Components.Aphid/Parser/AphidNodeCollection.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Components.Aphid.Parser
5 | {
6 | public abstract class AphidNodeCollection : AphidNode
7 | where TNodeType : AphidNode
8 | {
9 | private List _nodes = new List();
10 |
11 | public List Nodes
12 | {
13 | get { return _nodes; }
14 | set { _nodes = value; }
15 | }
16 | }
17 | }
18 |
19 |
--------------------------------------------------------------------------------
/Components.Aphid/Parser/AphidParserException.cs:
--------------------------------------------------------------------------------
1 | using Components.Aphid.Lexer;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace Components.Aphid.Parser
8 | {
9 | public class AphidParserException : Exception
10 | {
11 | public AphidToken Token { get; set; }
12 |
13 | public AphidParserException(AphidToken token)
14 | {
15 | Token = token;
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Components.Aphid/Parser/AphidRuntimeException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Components.Aphid.Parser
7 | {
8 | public class AphidRuntimeException : Exception
9 | {
10 | public AphidRuntimeException(string message, params object[] args)
11 | : base(string.Format(message, args))
12 | {
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Components.Aphid/Parser/ArrayAccessExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Components.Aphid.Parser
4 | {
5 | public class ArrayAccessExpression : Expression
6 | {
7 | public Expression ArrayExpression { get; set; }
8 |
9 | public Expression KeyExpression { get; set; }
10 |
11 | public ArrayAccessExpression ()
12 | {
13 | }
14 |
15 | public ArrayAccessExpression(Expression arrayExpression, Expression keyExpression)
16 | {
17 | ArrayExpression = arrayExpression;
18 | KeyExpression = keyExpression;
19 | }
20 | }
21 | }
22 |
23 |
--------------------------------------------------------------------------------
/Components.Aphid/Parser/ArrayExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Components.Aphid.Parser
7 | {
8 | public class ArrayExpression : Expression
9 | {
10 | public List Elements { get; set; }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Components.Aphid/Parser/BooleanExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Components.Aphid.Parser
8 | {
9 | public class BooleanExpression : Expression
10 | {
11 | public bool Value { get; set; }
12 |
13 | public BooleanExpression()
14 | {
15 | }
16 |
17 | public BooleanExpression(bool value)
18 | {
19 | Value = value;
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Components.Aphid/Parser/BreakExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Components.Aphid.Parser
7 | {
8 | public class BreakExpression : Expression
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Components.Aphid/Parser/CallExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace Components.Aphid.Parser
7 | {
8 | public class CallExpression : Expression
9 | {
10 | public Expression FunctionExpression { get; set; }
11 |
12 | public IEnumerable Args { get; set; }
13 |
14 | public CallExpression(Expression functionExpression, IEnumerable args)
15 | {
16 | FunctionExpression = functionExpression;
17 | Args = args;
18 | }
19 |
20 | public CallExpression(Expression functionExpression)
21 | : this (functionExpression, new Expression[0])
22 | {
23 |
24 | }
25 |
26 | public CallExpression(Expression functionExpression, Expression expression)
27 | : this(functionExpression, new[] { expression })
28 | {
29 | }
30 |
31 | public override string ToString()
32 | {
33 | return string.Format("{0}({1})", FunctionExpression, Args.Select(x => x.ToString()).DefaultIfEmpty().Aggregate((x, y) => x + ", " + y));
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/Components.Aphid/Parser/ControlFlowStatement.cs:
--------------------------------------------------------------------------------
1 | using Components.Aphid.Lexer;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace Components.Aphid.Parser
9 | {
10 | public class ControlFlowExpression : Expression
11 | {
12 | public AphidTokenType Type { get; set; }
13 |
14 | public Expression Condition { get; set; }
15 |
16 | public List Body { get; set; }
17 |
18 | public ControlFlowExpression(AphidTokenType type, Expression condition, List body)
19 | {
20 | Type = type;
21 | Condition = condition;
22 | Body = body;
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Components.Aphid/Parser/DynamicMemberExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Components.Aphid.Parser
4 | {
5 | public class DynamicMemberExpression : Expression
6 | {
7 | public Expression MemberExpression { get; set; }
8 |
9 | public DynamicMemberExpression ()
10 | {
11 | }
12 |
13 | public DynamicMemberExpression (Expression memberExpression)
14 | {
15 | MemberExpression = memberExpression;
16 | }
17 | }
18 | }
19 |
20 |
--------------------------------------------------------------------------------
/Components.Aphid/Parser/ElseExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Components.Aphid.Parser
5 | {
6 | public class ElseExpression
7 | {
8 | public List Body { get; set; }
9 |
10 | public ElseExpression()
11 | {
12 | }
13 |
14 | public ElseExpression(List body)
15 | {
16 | Body = body;
17 | }
18 | }
19 | }
20 |
21 |
--------------------------------------------------------------------------------
/Components.Aphid/Parser/Expression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Components.Aphid.Parser
4 | {
5 | public class Expression : AphidNode
6 | {
7 | }
8 | }
9 |
10 |
--------------------------------------------------------------------------------
/Components.Aphid/Parser/ForEachExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Components.Aphid.Parser
5 | {
6 | public class ForEachExpression : Expression
7 | {
8 | public Expression Collection { get; set; }
9 |
10 | public Expression Element { get; set; }
11 |
12 | public List Body { get; set; }
13 |
14 | public ForEachExpression (Expression collection, Expression element, List body)
15 | {
16 | Collection = collection;
17 | Element = element;
18 | Body = body;
19 | }
20 | }
21 | }
22 |
23 |
--------------------------------------------------------------------------------
/Components.Aphid/Parser/ForExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Components.Aphid.Parser
7 | {
8 | public class ForExpression : Expression
9 | {
10 | public Expression Initialization { get; set; }
11 |
12 | public Expression Condition { get; set; }
13 |
14 | public Expression Afterthought { get; set; }
15 |
16 | public List Body { get; set; }
17 |
18 | public ForExpression(
19 | Expression initialization,
20 | Expression condition,
21 | Expression afterthought,
22 | List body)
23 | {
24 | Initialization = initialization;
25 | Condition = condition;
26 | Afterthought = afterthought;
27 | Body = body;
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Components.Aphid/Parser/FunctionExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Components.Aphid.Parser
8 | {
9 | public class FunctionExpression : Expression
10 | {
11 | public List Args { get; set; }
12 |
13 | public List Body { get; set; }
14 |
15 | public override string ToString ()
16 | {
17 | return string.Format ("@({0}) {{ {1} }}",
18 | Args.Select(x => x.ToString()).DefaultIfEmpty().Aggregate((x, y) => x + " " + y),
19 | Body.Select(x => x.ToString()).DefaultIfEmpty().Aggregate((x, y) => x + " " + y));
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Components.Aphid/Parser/IdentifierExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Components.Aphid.Parser
7 | {
8 | public class IdentifierExpression : Expression
9 | {
10 | public string Identifier { get; set; }
11 |
12 | public IdentifierExpression(string identifier)
13 | {
14 | Identifier = identifier;
15 | }
16 |
17 | public override string ToString()
18 | {
19 | return Identifier;
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Components.Aphid/Parser/IfExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using Components.Aphid.Lexer;
4 |
5 | namespace Components.Aphid.Parser
6 | {
7 | public class IfExpression : ControlFlowExpression
8 | {
9 | public List ElseBody { get; set; }
10 |
11 | public IfExpression(Expression condition, List body, List elseBody)
12 | : base(AphidTokenType.ifKeyword, condition, body)
13 | {
14 | ElseBody = elseBody;
15 | }
16 | }
17 | }
18 |
19 |
--------------------------------------------------------------------------------
/Components.Aphid/Parser/LoadLibraryExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Components.Aphid.Parser
7 | {
8 | public class LoadLibraryExpression : Expression
9 | {
10 | public Expression LibraryExpression { get; set; }
11 |
12 | public LoadLibraryExpression(Expression libraryExpression)
13 | {
14 | LibraryExpression = libraryExpression;
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Components.Aphid/Parser/LoadScriptExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Components.Aphid.Parser
7 | {
8 | public class LoadScriptExpression : Expression
9 | {
10 | public Expression FileExpression { get; set; }
11 |
12 | public LoadScriptExpression(Expression fileExpression)
13 | {
14 | FileExpression = fileExpression;
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Components.Aphid/Parser/MemberExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Components.Aphid.Parser
8 | {
9 | public class MemberExpression : Expression
10 | {
11 | public IdentifierExpression Variable { get; set; }
12 | public List Members { get; set; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Components.Aphid/Parser/NullExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Components.Aphid.Parser
7 | {
8 | public class NullExpression : Expression
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Components.Aphid/Parser/NumberExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Components.Aphid.Parser
4 | {
5 | public class NumberExpression : Expression
6 | {
7 | public decimal Value { get; set; }
8 |
9 | public NumberExpression(decimal value)
10 | {
11 | Value = value;
12 | }
13 |
14 | public override string ToString ()
15 | {
16 | return Value.ToString ();
17 | }
18 | }
19 | }
20 |
21 |
--------------------------------------------------------------------------------
/Components.Aphid/Parser/ObjectExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Components.Aphid.Parser
8 | {
9 | public class ObjectExpression : Expression
10 | {
11 | public List Pairs { get; set; }
12 |
13 | public override string ToString()
14 | {
15 | return string.Format(
16 | "{{ {0} }}",
17 | Pairs
18 | .DefaultIfEmpty()
19 | .Select(x => x.ToString())
20 | .Aggregate((x, y) => x + ", " + y));
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Components.Aphid/Parser/PartialFunctionExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Components.Aphid.Parser
7 | {
8 | public class PartialFunctionExpression : Expression
9 | {
10 | public CallExpression Call { get; set; }
11 |
12 | public PartialFunctionExpression()
13 | {
14 | }
15 |
16 | public PartialFunctionExpression(CallExpression call)
17 | {
18 | Call = call;
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Components.Aphid/Parser/PatternMatchingExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Components.Aphid.Parser
7 | {
8 | public class PatternMatchingExpression : Expression
9 | {
10 | public Expression TestExpression { get; set; }
11 |
12 | public List> Patterns { get; set; }
13 |
14 | public PatternMatchingExpression()
15 | {
16 | Patterns = new List>();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Components.Aphid/Parser/Statement.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Components.Aphid.Parser
4 | {
5 | public class Statement : AphidNode
6 | {
7 |
8 | }
9 | }
--------------------------------------------------------------------------------
/Components.Aphid/Parser/StringExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Components.Aphid.Parser
7 | {
8 | public class StringExpression : ValueExpression
9 | {
10 | public StringExpression(string value)
11 | : base(value)
12 | {
13 | }
14 |
15 | public override string ToString()
16 | {
17 | return Value;
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Components.Aphid/Parser/ThisExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Components.Aphid.Parser
7 | {
8 | public class ThisExpression : Expression
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Components.Aphid/Parser/UnaryOperatorExpression.cs:
--------------------------------------------------------------------------------
1 | using Components.Aphid.Lexer;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace Components.Aphid.Parser
9 | {
10 | public class UnaryOperatorExpression : Expression
11 | {
12 | public AphidTokenType Operator { get; set; }
13 |
14 | public Expression Operand { get; set; }
15 |
16 | public bool IsPostfix { get; set; }
17 |
18 | public UnaryOperatorExpression(AphidTokenType op, Expression operand)
19 | {
20 | Operator = op;
21 | Operand = operand;
22 | }
23 |
24 | public override string ToString ()
25 | {
26 | return IsPostfix ?
27 | string.Format ("{0} {1}", Operand, Operator) :
28 | string.Format ("{0} {1}", Operator, Operand);
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Components.Aphid/Parser/ValueExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Components.Aphid.Parser
7 | {
8 | public class ValueExpression : Expression
9 | {
10 | public TValue Value { get; set; }
11 |
12 | public ValueExpression(TValue value)
13 | {
14 | Value = value;
15 | }
16 |
17 | public override string ToString()
18 | {
19 | return Value.ToString();
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Components.Aphid/Todo.txt:
--------------------------------------------------------------------------------
1 | Bin ops (+=, -=, etc)
2 | Regex support
3 | AOP
4 | Pattern matching
5 | string lower, upper
6 | Inline XML, XML deserialization
7 | Attributes
8 | Reflection
9 | Exception handling
10 | Assignment tests x=x x=y
11 | Command line args
--------------------------------------------------------------------------------
/Components.ConsolePlus/CliLexerState.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Components.ConsolePlus
7 | {
8 | ///
9 | /// An enumeration that represents the state of the lexer.
10 | ///
11 | public enum CliLexerState
12 | {
13 | ///
14 | /// Represents the text reading state
15 | ///
16 | ReadingText,
17 |
18 | ///
19 | /// Represents the token reading state
20 | ///
21 | ReadingToken,
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Components.ConsolePlus/Components.ConsolePlus.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/Components.ConsolePlus/DumpMode.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Components.ConsolePlus
7 | {
8 | public enum DumpMode
9 | {
10 | Table,
11 | Details,
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Components.Net/Components.Net.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/Components.Net/Http/ContentDisposition.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Components.Net.Http
8 | {
9 | public class ContentDisposition
10 | {
11 | public const string FormData = "form-data";
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Components.Net/Http/FieldValuePair.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Components.Net.Http
8 | {
9 | public class FieldValuePair
10 | {
11 | public string Field { get; set; }
12 |
13 | public string Value { get; set; }
14 |
15 | public FieldValuePair()
16 | {
17 | }
18 |
19 | public FieldValuePair(string field, string value)
20 | {
21 | Field = field;
22 | Value = value;
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Components.Net/Http/FormData.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace Components.Net.Http
9 | {
10 | public class FormData : HttpMessagePart
11 | {
12 | public string Header { get; private set; }
13 |
14 | public string StringValue { get; set; }
15 |
16 | public HttpUpload UploadValue { get; set; }
17 |
18 | public FormData(string value)
19 | {
20 | StringValue = value;
21 | }
22 |
23 | public FormData(HttpUpload value)
24 | {
25 | UploadValue = value;
26 | }
27 |
28 | public void SetHeader()
29 | {
30 | Header = GetAttributeString() + "\r\n\r\n";
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Components.Net/Http/FormUrlEncoder.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Components.Net.Http
8 | {
9 | public static class FormUrlEncoder
10 | {
11 | public static string Encode(IEnumerable pairs)
12 | {
13 | return pairs
14 | .Select(x =>
15 | Uri.EscapeDataString(x.Field) +
16 | "=" +
17 | Uri.EscapeDataString(x.Value))
18 | .Aggregate((x, y) => x + "&" + y);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Components.Net/Http/HttpConnection.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Components.Net.Http
8 | {
9 | public static class HttpConnection
10 | {
11 | public const string KeepAlive = "Keep-Alive";
12 | public const string Close = "close";
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Components.Net/Http/HttpField.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Components.Net.Http
8 | {
9 | public static class HttpField
10 | {
11 | public const string Host = "Host";
12 | public const string ContentType = "Content-Type";
13 | public const string ContentLength = "Content-Length";
14 | public const string UserAgent = "User-Agent";
15 | public const string ContentDisposition = "Content-Disposition";
16 | public const string Accept = "Accept";
17 | public const string Connection = "Connection";
18 | public const string TransferEncoding = "Transfer-Encoding";
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Components.Net/Http/HttpMethod.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Components.Net.Http
8 | {
9 | public static class HttpMethod
10 | {
11 | public const string Get = "GET";
12 | public const string Head = "HEAD";
13 | public const string Post = "POST";
14 | public const string PUT = "PUT";
15 | public const string Delete = "DELETE";
16 | public const string Trace = "TRACE";
17 | public const string Options = "OPTIONS";
18 | public const string Connect = "CONNECT";
19 | public const string Patch = "PATCH";
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Components.Net/Http/HttpResponse.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace Components.Net.Http
9 | {
10 | public class HttpResponse : HttpMessagePart
11 | {
12 | public bool IsChunked { get; set; }
13 |
14 | public Stream BodyStream { get; set; }
15 |
16 | public string GetBodyString()
17 | {
18 | BodyStream.Position = 0;
19 |
20 | Stream stream;
21 |
22 | if (IsChunked)
23 | {
24 | stream = new MemoryStream();
25 | ChunkedTransferEncoding.Decode(BodyStream, stream);
26 | }
27 | else
28 | {
29 | stream = BodyStream;
30 | }
31 |
32 | return new StreamReader(stream).ReadToEnd();
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/Components.Net/Http/HttpUpload.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace Components.Net.Http
9 | {
10 | public class HttpUpload
11 | {
12 | public string Name { get; set; }
13 |
14 | public string Filename { get; set; }
15 |
16 | public string FileMimeType { get; set; }
17 |
18 | public Stream Stream { get; set; }
19 |
20 | public HttpUpload()
21 | {
22 | FileMimeType = MimeType.ApplicationOctetStream;
23 | }
24 |
25 | public HttpUpload(string name, string filename, Stream stream)
26 | : this()
27 | {
28 | Name = name;
29 | Filename = filename;
30 | Stream = stream;
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Components.Net/Http/HttpVersion.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Components.Net.Http
8 | {
9 | public static class HttpVersion
10 | {
11 | public const string V10 = "1.0";
12 | public const string V11 = "1.1";
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Components.Net/Http/MimeType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Components.Net.Http
8 | {
9 | public static class MimeType
10 | {
11 | public const string ApplicationOctetStream = "application/octet-stream";
12 | public const string Multipart = "multipart/form-data";
13 | public const string FormUrlEncoded = "application/x-www-form-urlencoded";
14 | public const string TextPlain = "text/plain";
15 | public const string TextHtml = "text/html";
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Components/ByteArrayExtension.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 |
7 | namespace Components
8 | {
9 | public static class ByteArrayExtension
10 | {
11 | private static Encoding _encoding = Encoding.GetEncoding("iso-8859-1");
12 |
13 | public static string GetString(this byte[] Bytes)
14 | {
15 | return _encoding.GetString(Bytes);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Components/CodeExpressionExtension.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.CodeDom;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace Components
9 | {
10 | public static class CodeExpressionExtension
11 | {
12 | public static CodePropertyReferenceExpression GetProperty(this CodeExpression expression, string name)
13 | {
14 | return new CodePropertyReferenceExpression(expression, name);
15 | }
16 |
17 | public static CodeMethodReferenceExpression GetMethod(this CodeExpression expression, string name)
18 | {
19 | return new CodeMethodReferenceExpression(expression, name);
20 | }
21 |
22 | public static CodeMethodInvokeExpression InvokeMethod(
23 | this CodeExpression expression,
24 | string name,
25 | params CodeExpression[] parameters)
26 | {
27 | return new CodeMethodReferenceExpression(expression, name).Invoke(parameters);
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Components/CodeMemberMethodExtension.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.CodeDom;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace Components
9 | {
10 | public static class CodeMemberMethodExtension
11 | {
12 | public static void AddParameter(this CodeMemberMethod method, Type type, string name)
13 | {
14 | method.Parameters.Add(new CodeParameterDeclarationExpression(type, name));
15 | }
16 |
17 | public static void AddParameter(this CodeMemberMethod method, string type, string name)
18 | {
19 | method.Parameters.Add(new CodeParameterDeclarationExpression(type, name));
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Components/CodeMethodReferenceExpressionExtension.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.CodeDom;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace Components
9 | {
10 | public static class CodeMethodReferenceExpressionExtension
11 | {
12 | public static CodeMethodInvokeExpression Invoke(this CodeMethodReferenceExpression expression, params CodeExpression[] parameters)
13 | {
14 | return new CodeMethodInvokeExpression(expression, parameters);
15 | }
16 |
17 |
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Components/Components.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/Components/DictionaryExtension.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Components
7 | {
8 | public static class DictionaryExtension
9 | {
10 | public static TValue GetValueOrDefault(this Dictionary dictionary, TKey key)
11 | {
12 | return dictionary.ContainsKey(key) ? dictionary[key] : default(TValue);
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Components/HashAlgorithmExtension.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Security.Cryptography;
6 |
7 | namespace Components
8 | {
9 | public static class HashAlgorithmExtension
10 | {
11 | public static string ComputeHash(this HashAlgorithm Hash, string Buffer)
12 | {
13 | StringBuilder digestString = new StringBuilder();
14 |
15 | foreach (byte b in Hash.ComputeHash(ASCIIEncoding.ASCII.GetBytes(Buffer)))
16 | digestString.Append(Convert.ToString(b, 16).PadLeft(2, '0'));
17 |
18 | return digestString.ToString();
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Components/IServiceLocator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Components
8 | {
9 | public interface IServiceLocator
10 | {
11 | bool IsRegistered();
12 | void Register(TService service);
13 | TService Resolve();
14 | TService ResolveOrCreate(Func create);
15 | TService ResolveOrCreate() where TService : new();
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Components/ItemEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Components
7 | {
8 | public class ItemEventArgs : EventArgs
9 | {
10 | public TItem Item { get; set; }
11 |
12 | public ItemEventArgs(TItem item)
13 | {
14 | Item = item;
15 | }
16 |
17 | public ItemEventArgs() { }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Components/PluginLoader.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Reflection;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace Components
9 | {
10 | public class PluginLoader
11 | {
12 | public IEnumerable Load(Assembly asm)
13 | {
14 | return asm
15 | .GetTypes()
16 | .Where(x => x.IsDerivedFromOrImplements())
17 | .Select(Activator.CreateInstance)
18 | .Cast();
19 | }
20 |
21 | public IEnumerable Load()
22 | {
23 | return Load(Assembly.GetCallingAssembly());
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Components/StringEnumerableExtension.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Components
7 | {
8 | public static class StringEnumerableExtension
9 | {
10 | public static string Join(this IEnumerable source, string delimiter)
11 | {
12 | return source.Aggregate((x, y) => x + delimiter + y);
13 | }
14 |
15 | public static string Join(this IEnumerable source)
16 | {
17 | return source.Join("");
18 | }
19 |
20 | public static string JoinLines(this IEnumerable source)
21 | {
22 | return source.Join("\r\n");
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Components/WebClientHelperResponse.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Components
7 | {
8 | public class WebClientHelperResponse
9 | {
10 | public string Info { get; private set; }
11 |
12 | public byte[] Data { get; private set; }
13 |
14 | public WebClientHelperResponse(string info, byte[] data)
15 | {
16 | Info = info;
17 | Data = data;
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Components/XmlSerializerExtension.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.IO;
6 | using System.Xml.Serialization;
7 |
8 | namespace Components
9 | {
10 | public static class XmlSerializerExtensions
11 | {
12 | public static void Serialize(this XmlSerializer Serializer, string Filename, object o)
13 | {
14 | using (var s = File.Create(Filename))
15 | Serializer.Serialize(s, o);
16 | }
17 |
18 | public static string Serialize(this XmlSerializer Serializer, object o)
19 | {
20 | using (var s = new MemoryStream())
21 | {
22 | Serializer.Serialize(s, o);
23 |
24 | s.Position = 0;
25 |
26 | using (var reader = new StreamReader(s))
27 | return reader.ReadToEnd();
28 | }
29 | }
30 |
31 | public static object Deserialize(this XmlSerializer Serializer, string Filename)
32 | {
33 | using (var s = File.OpenRead(Filename))
34 | return Serializer.Deserialize(s);
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/ComponentsUnitTests/ComponentsUnitTests.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/ComponentsUnitTests/UnitTest1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Text;
3 | using Microsoft.VisualStudio.TestTools.UnitTesting;
4 | using Components;
5 |
6 | namespace ComponentsUnitTests
7 | {
8 | [TestClass]
9 | public class ExtensionUnitTests
10 | {
11 | [TestMethod, TestCategory("GeneralExtensions")]
12 | public void StringToBytesTestMethod()
13 | {
14 | var sb = new StringBuilder();
15 |
16 | for (var i = 0; i < 256; i++)
17 | {
18 | sb.Append((char)i);
19 | }
20 |
21 | var s = sb.ToString();
22 | var b = s.GetBytes();
23 |
24 | for (var i = 0; i < 256; i++)
25 | {
26 | Assert.AreEqual((byte)i, b[i]);
27 | }
28 | }
29 |
30 | [TestMethod, TestCategory("GeneralExtensions")]
31 | public void BytesToStringTestMethod()
32 | {
33 | var b = new byte[256];
34 |
35 | for (var i = 0; i < 256; i++)
36 | {
37 | b[i] = (byte)i;
38 | }
39 |
40 | var s = b.GetString();
41 |
42 | for (var i = 0; i < 256; i++)
43 | {
44 | Assert.AreEqual((byte)i, (byte)s[i]);
45 | }
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/LLex/BinaryExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace LLex
7 | {
8 | public class BinaryExpression : RegexExpression
9 | {
10 | public RegexExpression Left { get; private set; }
11 |
12 | public RegexTokenType Operator { get; private set; }
13 |
14 | public RegexExpression Right { get; private set; }
15 |
16 | public BinaryExpression(RegexExpression left, RegexTokenType op, RegexExpression right)
17 | {
18 | Left = left;
19 | Operator = op;
20 | Right = right;
21 | }
22 |
23 | public override string ToString()
24 | {
25 | var op = Operator == RegexTokenType.OrOperator ? "|" : "";
26 |
27 | return string.Format("{0}{1}{2}", Left, op, Right);
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/LLex/CharExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace LLex
7 | {
8 | public class CharExpression : RegexExpression
9 | {
10 | public char Char { get; private set; }
11 |
12 | public CharExpression(char c)
13 | {
14 | Char = c;
15 | }
16 |
17 | public override string ToString()
18 | {
19 | return System.Text.RegularExpressions.Regex.Escape(Char.ToString()) + base.ToString();
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/LLex/GroupExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace LLex
7 | {
8 | public class GroupExpression : RegexExpression
9 | {
10 | public RegexExpression Expression { get; private set; }
11 |
12 | public GroupExpression(RegexExpression expression)
13 | {
14 | Expression = expression;
15 | }
16 |
17 | public override string ToString()
18 | {
19 | return string.Format("({0}){1}", Expression, base.ToString());
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/LLex/LLex.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/LLex/LLexNameInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace LLex
7 | {
8 | public class LLexNameInfo
9 | {
10 | public string FullName { get; set; }
11 |
12 | public string Name { get; set; }
13 |
14 | public string Namespace { get; set; }
15 |
16 | public string LexerName { get; set; }
17 |
18 | public string TokenName { get; set; }
19 |
20 | public string TokenTypeName { get; set; }
21 |
22 | public static LLexNameInfo Parse(string fullName)
23 | {
24 | var lastDot = fullName.LastIndexOf('.');
25 | string name = fullName.Substring(lastDot + 1);
26 |
27 | return new LLexNameInfo()
28 | {
29 | FullName = fullName,
30 | Name = name,
31 | Namespace = fullName.Remove(lastDot),
32 | LexerName = name + "Lexer",
33 | TokenName = name + "Token",
34 | TokenTypeName = name + "TokenType",
35 | };
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/LLex/LexFileMode.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace LLex
7 | {
8 | public enum LexFileMode
9 | {
10 | Normal,
11 | Code,
12 | Keyword,
13 | KeywordDefault,
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/LLex/LexerState.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace LLex
7 | {
8 | public class LexerState
9 | {
10 | public char State { get; set; }
11 | public string Token { get; set; }
12 | public string Code { get; set; }
13 | public int? NewMode { get; set; }
14 | public List Children { get; set; }
15 |
16 | public LexerState(char state, string token, List children)
17 | {
18 | State = state;
19 | Token = token;
20 | Children = children;
21 | }
22 |
23 | public LexerState(char state, string token)
24 | : this(state, token, null)
25 | {
26 | }
27 |
28 | public LexerState(List children)
29 | : this((char)0, "None", children)
30 | {
31 |
32 | }
33 |
34 | public LexerState()
35 | : this((char)0, "None", new List())
36 | {
37 |
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/LLex/OperatorExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace LLex
7 | {
8 | public class OperatorExpression : RegexExpression
9 | {
10 | public RegexTokenType Type { get; private set; }
11 |
12 | public OperatorExpression(RegexTokenType type)
13 | {
14 | Type = type;
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/LLex/RegexExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace LLex
7 | {
8 | public abstract class RegexExpression : RegexNode
9 | {
10 | public RegexTokenType Quantifier { get; set; }
11 |
12 | public override string ToString()
13 | {
14 | return Quantifier == RegexTokenType.None ? "" :
15 | Quantifier == RegexTokenType.OneOrMoreQuantifier ? "+" :
16 | Quantifier == RegexTokenType.ZeroOrMoreQuantifier ? "*" :
17 | Quantifier == RegexTokenType.ZeroOrOneQuantifier ? "?" :
18 | "[Error]";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/LLex/RegexNode.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace LLex
7 | {
8 | public abstract class RegexNode
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/LLex/Resources/AddTokenTemplate.cs:
--------------------------------------------------------------------------------
1 | var index = lastIndex + 1;
2 | var lexeme = text.Substring(index, charIndex - lastIndex);
3 |
4 | tokens.Add(new {Token}(tokenType, lexeme, index));
5 |
--------------------------------------------------------------------------------
/LLex/Resources/CaseTemplate.cs:
--------------------------------------------------------------------------------
1 | case '{{Char}}':
2 | {{States}}
3 | {{Body}}
--------------------------------------------------------------------------------
/LLex/Resources/RootStateTemplate.cs:
--------------------------------------------------------------------------------
1 | if (charIndex < lastIndex)
2 | {
3 | currentChar = text[++charIndex];
4 |
5 | switch (currentChar)
6 | {
7 | {{States}}
8 | }
9 |
10 | return {TokenType}.Unknown;
11 | }
--------------------------------------------------------------------------------
/LLex/Resources/StateTemplate.cs:
--------------------------------------------------------------------------------
1 | if (charIndex < lastIndex)
2 | {
3 | currentChar = text[++charIndex];
4 |
5 | switch (currentChar)
6 | {
7 | {{States}}
8 | }
9 |
10 | PreviousChar();
11 | }
--------------------------------------------------------------------------------
/LLex/TokenEntry.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace LLex
7 | {
8 | public class TokenEntry
9 | {
10 | public int? NewMode { get; set; }
11 | public string Lexeme { get; set; }
12 | public string TokenType { get; set; }
13 | public string Code { get; set; }
14 |
15 | public TokenEntry(string lexeme, string tokenType, string code, int? newMode)
16 | {
17 | Lexeme = lexeme;
18 | NewMode = newMode;
19 | TokenType = tokenType;
20 | Code = code;
21 | }
22 |
23 | public TokenEntry(string lexeme, string tokenType)
24 | : this(lexeme, tokenType, null, null)
25 | {
26 | }
27 |
28 | public TokenEntry(string lexeme, string tokenType, string code)
29 | : this(lexeme, tokenType, code, null)
30 | {
31 | }
32 |
33 | public override string ToString()
34 | {
35 | return Lexeme;
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/LLex/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/LLex/regex.ll:
--------------------------------------------------------------------------------
1 | LLex.Regex
2 |
3 | Regex
4 |
5 | \( LeftParenthesis
6 | \) RightParenthesis
7 | \[ LeftBracket
8 | \] RightBracket
9 | \| OrOperator
10 | \? ZeroOrOneQuantifier
11 | \* ZeroOrMoreQuantifier
12 | \+ OneOrMoreQuantifier
13 |
14 | \\s SpecialCharacter
15 | \\r SpecialCharacter
16 | \\n SpecialCharacter
17 | \\t SpecialCharacter
18 | \\v SpecialCharacter
19 |
20 | \\\( Character
21 | \\\) Character
22 | \\\[ Character
23 | \\\] Character
24 | \\\| Character
25 | \\\? Character
26 | \\\* Character
27 | \\\+ Character
28 | \\\\ Character
29 |
30 | %%
31 | return RegexTokenType.Character;
32 | %%
--------------------------------------------------------------------------------
/LexerTestGenerator/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/LexerTestGenerator/LexerTestGenerator.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/LexerTestGenerator/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/MonoBuildScriptGenerator/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/MonoBuildScriptGenerator/BuildScriptGenerator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace MonoBuildScriptGenerator
8 | {
9 | public abstract class BuildScriptGenerator
10 | {
11 | public abstract string CreateScript(Project project);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/MonoBuildScriptGenerator/MonoBuildScriptGenerator.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/MonoBuildScriptGenerator/Project.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace MonoBuildScriptGenerator
8 | {
9 | public class Project
10 | {
11 | public string CSProj { get; set; }
12 | public string OutFile { get; set; }
13 | public IEnumerable Reference { get; set; }
14 | public IEnumerable CompilationSymbols { get; set; }
15 | public IEnumerable Compile { get; set; }
16 | public IEnumerable Copies { get; set; }
17 |
18 | public Project(
19 | string csproj,
20 | IEnumerable reference,
21 | IEnumerable compile,
22 | string outFile = null,
23 | IEnumerable compilationSymbols = null,
24 | IEnumerable copies = null)
25 | {
26 | CSProj = csproj;
27 | OutFile = outFile;
28 | Reference = reference;
29 | Compile = compile;
30 | CompilationSymbols = compilationSymbols;
31 | Copies = copies;
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/MonoBuildScriptGenerator/phpvh.cmd:
--------------------------------------------------------------------------------
1 | :: SourceDir must have trailing slash!
2 | SET SourceDir=C:\source\PhpVH\
3 | MonoBuildScriptGenerator "%SourceDir%PhpVH\PhpVH.csproj,%SourceDir%Components\Components.csproj" "%SourceDir%PhpVH\bin\debug\phpvhm.exe" "%SourceDir%PhpVH\b.bat"
4 | CALL "%SourceDir%PhpVH\b.bat"
--------------------------------------------------------------------------------
/PhpVH.SelfTest/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/PhpVH.SelfTest/NUnitResults.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Xml.Linq;
7 |
8 | namespace PhpVH.SelfTest
9 | {
10 | public class NUnitResults
11 | {
12 | private XElement _xElement;
13 |
14 | private NUnitResults()
15 | {
16 | }
17 |
18 | public static NUnitResults Load(string uri)
19 | {
20 | return new NUnitResults()
21 | {
22 | _xElement = XElement.Load(uri),
23 | };
24 | }
25 |
26 | public IEnumerable GetTestCases()
27 | {
28 | return _xElement.Descendants("test-case");
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/PhpVH.SelfTest/PhpVH.SelfTest.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/PhpVH.SelfTest/SelfTest.cs:
--------------------------------------------------------------------------------
1 | using Components.Aphid.Interpreter;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace PhpVH.SelfTest
9 | {
10 | public class SelfTest
11 | {
12 | [AphidProperty("name")]
13 | public string Name { get; set; }
14 |
15 | [AphidProperty("arg")]
16 | public string Arg { get; set; }
17 |
18 | [AphidProperty("msgs")]
19 | public string[] Messages { get; set; }
20 |
21 | [AphidProperty("required")]
22 | public string[] Required { get; set; }
23 |
24 | public SelfTest()
25 | {
26 | }
27 |
28 | public SelfTest(string name, string arg, string[] messages)
29 | {
30 | Name = name;
31 | Arg = arg;
32 | Messages = messages;
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/PhpVH.SelfTest/SelfTestAssembly.cs:
--------------------------------------------------------------------------------
1 | using Components.Aphid.Interpreter;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace PhpVH.SelfTest
9 | {
10 | public class SelfTestAssembly
11 | {
12 | [AphidProperty("asm")]
13 | public string Assembly { get; set; }
14 |
15 | [AphidProperty("tests")]
16 | public SelfTest[] Tests { get; set; }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/PhpVH.SelfTest/TestResult.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PhpVH.SelfTest
8 | {
9 | public class TestResult
10 | {
11 | public string Name { get; set; }
12 |
13 | public string Message { get; set; }
14 |
15 | public string Details { get; set; }
16 |
17 | public bool Succeeded { get; set; }
18 |
19 | public bool Skipped { get; set; }
20 |
21 | public int Passed { get; set; }
22 |
23 | public int Total { get; set; }
24 |
25 | public TestResult()
26 | {
27 | }
28 |
29 | public TestResult(string name, string message, string details, bool succeeded, int passed, int total)
30 | {
31 | Name = name;
32 | Message = message;
33 | Details = details;
34 | Succeeded = succeeded;
35 | Passed = passed;
36 | Total = total;
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/ApiOverrideTester.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using Components;
8 |
9 | namespace PhpVH.Tests.Integration
10 | {
11 | public class ApiOverrideTester
12 | {
13 | private string PatchCode(string code)
14 | {
15 | code = PreloadHelper.PatchArrayFunctions("");
16 | var include =
17 | File.ReadAllText("PhpResources\\SuperGlobalOverride.php") +
18 | File.ReadAllText("PhpResources\\PhpApiOverrides.php");
19 | code = code.Insert(6, include);
20 | return code;
21 | }
22 |
23 | public void RunBooleanOverrideTest(string template)
24 | {
25 | var tester = new PhpTester();
26 | GetArrays().Iter(x => tester.RunBooleanTest(PatchCode(string.Format(template, x))));
27 | }
28 |
29 | public IEnumerable GetArrays()
30 | {
31 | return Php.Superglobals.Concat(new[] { "$a" });
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/ArbitraryRead/ArbitraryRead.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/ArbitraryUpload/ArbitraryUpload.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/CodeCoverage/CodeCoverage.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/CodeCoverage/CodeCoverage2.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/CodeCoverage/CodeCoverage3.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/CodeCoverage/CodeCoverage4.php:
--------------------------------------------------------------------------------
1 | Nothing to see here
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/CommandInjection/ArbitraryCommandCookie.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/CommandInjection/ArbitraryCommandGet.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/CommandInjection/ArbitraryCommandGet2.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/CommandInjection/ArbitraryCommandPost.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/CommandInjection/ArbitraryCommandPost2.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/DynamicInvocation/DynamicClass.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/DynamicInvocation/DynamicClass2.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/DynamicInvocation/DynamicFunction.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/DynamicInvocation/DynamicFunction2.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/FalsePositiveCheck.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/LocalFileInclusion/LfiCookie.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/LocalFileInclusion/LfiGet.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/LocalFileInclusion/LfiPost.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/OpenRedirect/OpenRedirect.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/OpenRedirect/OpenRedirect2.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/PhpInjection/ArbitraryPhpCookie.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/PhpInjection/ArbitraryPhpGet.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/PhpInjection/ArbitraryPhpPost.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/SqlInjection/SqlInjectionCookie.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/SqlInjection/SqlInjectionGet.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/SqlInjection/SqlInjectionGet2.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/SqlInjection/SqlInjectionGet3.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/SqlInjection/SqlInjectionGet4.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/SqlInjection/SqlInjectionGet5.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/SqlInjection/SqlInjectionPost.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/SqlInjection/SqliteInjectionGet.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/SqlInjection/SqliteInjectionGet2.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/SqlInjection/SqliteInjectionGet3.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/SqlInjection/SqliteInjectionGet4.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/Xss/XssAttribute.php:
--------------------------------------------------------------------------------
1 | test';
3 | ?>
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/Xss/XssBadFilter.php:
--------------------------------------------------------------------------------
1 | ", "", $_GET['message']);
3 | ?>
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/Xss/XssGet.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/Xss/XssGet2.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/Php/Xss/XssPost.php:
--------------------------------------------------------------------------------
1 | test';
3 | ?>
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/PhpVH.Tests.Integration.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Integration/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Unit/FormScraperTest.cs:
--------------------------------------------------------------------------------
1 | using NUnit.Framework;
2 |
3 | namespace PhpVH.Tests.Unit
4 | {
5 | [TestFixture, Category("FormScraper")]
6 | public class FormScraperTest : HtmlTest
7 | {
8 | private FormTag[] GetForms(string testFile)
9 | {
10 | return FormScraper.GetForms(LoadResource(testFile), "GET");
11 | }
12 |
13 | [Test]
14 | public void GetFormsTestMethod()
15 | {
16 | var forms = GetForms("Form1");
17 | Assert.AreEqual(1, forms.Length);
18 | }
19 |
20 | [Test]
21 | public void GetInputsTestMethod()
22 | {
23 | var inputs = GetForms("Form1")[0].Inputs;
24 | Assert.AreEqual(2, inputs.Length);
25 | }
26 |
27 | [Test]
28 | public void GetAttributesTestMethod()
29 | {
30 | var inputs = GetForms("Form1")[0].Inputs;
31 | Assert.AreEqual("testType", inputs[0].Type);
32 | Assert.AreEqual("testValue", inputs[0].Value);
33 | Assert.AreEqual("testType2", inputs[1].Type);
34 | Assert.AreEqual("testValue2", inputs[1].Value);
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Unit/Html/AbsoluteUri.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | http://localhost/foo.php
10 |
11 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Unit/Html/AbsoluteUri2.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | http://localhost/foo.php
10 |
11 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Unit/Html/AbsoluteUri3.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | http://localhost/foo.phpshit
10 |
11 |
--------------------------------------------------------------------------------
/PhpVH.Tests.Unit/Html/Form1.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |