You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
>In computer programming, the interpreter pattern is a design pattern that specifies how to evaluate sentences in a language. The basic idea is to have a class for each symbol (terminal or nonterminal) in a specialized computer language. The syntax tree of a sentence in the language is an instance of the composite pattern and is used to evaluate (interpret) the sentence.
Behind its `$parse`service, AngularJS provides its own implementation of interpreter of a DSL (Domain Specific Language). The used DSL is simplified and modified version of JavaScript.
672
-
The main differences between the JavaScript expressions and AngularJS expressions that AngularJS expressions:
671
+
`$parse`サービスの背後では、AngularJSは独自のDSL(Domain Specific Language)記法のインタープリタを実装しています。DSLはシンプルに変更されたJavaScriptです。
672
+
JavaScript記法とAngularJS機能の主な違いとして、AngularJS記法は:
673
673
674
-
-may contain filters with UNIX like pipe syntax
675
-
-don't throw any errors
676
-
-don't have any control flow statements (exceptions, loops, if statements although you can use the ternary operator)
677
-
-are evaluated in given context (the context of the current `$scope`)
674
+
-UNIX的なパイプ・シンタックスを含んでいること
675
+
-エラーを投げないこと
676
+
-コントロール・フロー文をもたないこと(オペレータは使えるが、例外、ループ、if文は持たない)
677
+
-所与のコンテクスト内で評価されること(現在の `$scope` のコンテクスト)
678
678
679
-
Inside the `$parse`service are defined two main components:
679
+
`$parse`サービスのの内部では2つの主なコンポーネントが定義されています:
680
680
681
681
```JavaScript
682
-
//Responsible for converting given string into tokens
682
+
//与えられた文字列をトークンに変換する責務を追う
683
683
var Lexer;
684
-
//Responsible for parsing the tokens and evaluating the expression
684
+
//トークンをパースして式を評価する責務を追う
685
685
var Parser;
686
686
```
687
687
688
-
Once given expression have been tokenized it is cached internally, because of performance concerns.
688
+
式がトークン化されると、パフォーマンスのために内部にキャッシュされます。
689
689
690
-
The terminal expressions in the AngularJS DSL are defined as follows:
690
+
AngularJS DSLではオペレータは下記のように定義されています:
691
691
692
692
```JavaScript
693
693
varOPERATORS= {
@@ -720,14 +720,14 @@ var OPERATORS = {
720
720
};
721
721
```
722
722
723
-
We can think of the function associated with each terminal as implementation of the `AbstractExpression`'s interface.
0 commit comments