GithubHelp home page GithubHelp logo

aoisupersix / bve5_parsing Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 3.0 9.97 MB

.NET Parsing Library for BveTrainsim 5.

License: MIT License

C# 95.10% ANTLR 3.95% JavaScript 0.76% TypeScript 0.18%
bve5 bve5-parsing nuget parsing-library

bve5_parsing's People

Contributors

allcontributors[bot] avatar aoisupersix avatar renovate-bot avatar s520 avatar tim-a-tanaka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bve5_parsing's Issues

ASTで保持する構文情報を増やす

現在マップ要素と関数しかないので、構文の種類が特定しづらい。

関数名にドットが入る関数(Track[].X.Interpolateみたいな)はSubElement:XとFunction:Interpolateに分解する

Includeディレクティブの対応

Includeディレクティブは、その構文位置に指定されたマップ構文ファイル(ヘッダを除く)を挿入する機能らしい。
つまり、Includeディレクティブの動作としては、

  1. 指定されたマップ構文ファイルを読み込み
  2. ファイルヘッダを削除
  3. Includeディレクティブを読み込んだマップ構文で置き換え
    ということになる。

これを実装するためには、

  1. デベロッパーがBve5_Parsingを利用する前にIncludeディレクティブを構文で置き換え
  2. Bve5_Parsingのパース前にIncludeディレクティブを構文で置き換え
    という2つの方法がいいかな。

デフォルトでは2のBve5_Parsing内で置き換えを行って、オプションとして置き換えを行わずにパース可能にする

ASTを構文ごとに分割する

#42 対応のため。
現在引数を辞書形で無理やりやっているところを、クラスのプロパティに改修する。
また、EvaluteするかASTをそのまま返すか、デベロッパーが選択できるようにする(これは #39 で対応)

VariableStoreはstaticじゃない

パースごとにVariableStoreのインスタンスを作る方が正しい気がする。
ついでにVariableStoreをパース間で引き継げるようにする。

Travis CIのテストが走らなくなってしまった

#82 をマージしたらテストが走らなくなってしまったので修正する

以下エラー:

Starting test execution, please wait...
Unable to find /home/travis/build/aoisupersix/Bve5_Parsing/Bve5_ParsingTests/bin/Debug/netcoreapp2.0/testhost.dll. Please publish your test project and retry.
Test run in progress.Test Run Aborted.

ファイルヘッダーの定義変更

どうやら本家ソフトは

  • 空白(スペース)は文字間に必ず一つ
  • ファイルヘッダに空白は不可
  • 大文字小文字は無視でOK
    らしいのでそれ準拠に変更する

SecrityAlertの修正

b5gのbracesが原因。0.0.3で解決させたと思うのでパッケージを更新する

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Warning

These dependencies are deprecated:

Datasource Name Replacement PR?
npm tslint Unavailable

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update dependency b5g to v0.1.2
  • Update dependency linq to v3.2.4
  • Update dependency mustache to v4.2.0
  • Update dependency typescript to v3.9.10
  • Update xunit-dotnet monorepo (xunit, xunit.runner.visualstudio)
  • Update dependency @types/node to v20
  • Update dependency Microsoft.NET.Test.Sdk to v17
  • Update dependency linq to v4
  • Update dependency tslint to v6
  • Update dependency typescript to v5
  • 🔐 Create all rate-limited PRs at once 🔐

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
gen-old/package.json
  • fs 0.0.2
  • linq ^3.1.1
  • mustache ^4.0.0
  • strip-bom ^4.0.0
gen/package.json
  • b5g 0.0.3
  • fs 0.0.2
  • typescript ^3.5.3
  • @types/node 12.12.28
  • ts-node 8.6.2
  • tslint 5.20.1
  • tslint-config-airbnb 5.11.2
  • tsutils 3.17.1
nuget
Bve5_Parsing/Bve5_Parsing.csproj
  • System.Text.Encoding.CodePages 4.5.1
  • System.Dynamic.Runtime 4.3.0
  • Microsoft.CSharp 4.5.0
  • ReadJEnc 1.3.1.2
  • Antlr4.Runtime 4.6.6
  • Antlr4 4.6.6
Bve5_ParsingDoc/Bve5_ParsingDoc.csproj
  • docfx.console 2.49.0
Bve5_ParsingTests/Bve5_ParsingTests.csproj
  • dotnet-xunit 2.3.1
  • xunit.runner.visualstudio 2.4.1
  • xunit 2.4.1
  • Microsoft.NET.Test.Sdk 16.5.0

  • Check this box to trigger a request for Renovate to run again on this repository

TODO: Readme.mdの改善

もっとわかりやすいドキュメントにする。

追加予定

  • 構文解析の評価(戻り値)の詳細
  • ファイルの構造など
  • もっとそれらしい画像

細かい構文の修正

  • Legacy構文の引数名startがParserRuleContextとかぶってる
  • Legacy構文のASTノードを作る
  • Include構文でディレクトリの大文字小文字を無視できるようにする

MapGrammar例外処理の追加

MapGrammarのパース処理に関する例外処理やエラーメッセージの追加。

取り敢えず現状の問題点↓

  • MapGrammarの第一ステートメントに予期しない構文が入力された場合、その後のステートメントがパースされない。
  • 数式の項に文字列が含まれていた際の演算で、'+'以外の演算子を利用していた場合に例外が発生する。
  • パーサのエラーメッセージが単純に分かりづらい。

TODO: 例外処理におけるファイル名の取得

構文解析の結果、構文が正しくない場合はScriptExceptionを返すが、現時点では例外の中にファイル名が含まれていないので、どのファイルの例外か判別できない。

改善案

  • ScriptException内のinnerExceptionにファイル名を含む例外を入れておく
  • 独自の例外を追加する

参考

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.