/** * Declares an abstract interpretation operation * @author stone * */public interface Interpreter {public void interpret (context context); In practice, you can have a returned type that defines the data object that is interpreted}public class Xmlsaxinterpreter implements interpreter {@Overridepublic void interpret (context context) { SYSTEM.OUT.PRINTLN ("XML SAX In
The parser is an example of parsing in accordance with the prescribed syntax, which is used less in the current project, defined as follows: Given a language, define a representation of its grammar, and define an interpreter that interprets the sentences in the language.Personal UnderstandingThe interpreter pattern is seldom used in the project because he can cause problems such as efficiency, performance,
Design Mode note Interpreter mode Interpreter
// Interpreter mode ---- class behavior mode
/*
1: Intention:
Given a language, it defines a representation of its syntax and an interpreter that uses this representation to interpret sentences in the language.
2: motivation:
3: Applicability:
When a language needs to be
In Win32 GNU Common Lisp development environment, after GNU Common Lisp is installed in Win32 environment, a shortcut is generated in the Start menu to view its attributes,The start position is blank. After the shortcut is copied to any directory for running, the running directory will be used as the current path. I create a lispworks folder on the desktop as the project directory for practice, and then use
Interpreter interpreter mode (behavioral mode)Motive (motivation)In the software construction process, if a particular area of the problem is more complex, similar patterns are repeated, if the use of ordinary programming to achieve will face very frequent changes.In this case, the problem of a particular domain is expressed as a sentence under some grammatical rule, and then an
Interpreter mode (Interpreter ):
Given a language, it defines a syntax expression and an interpreter that uses this representation to explain sentences in a statement.
Structure:
ExampleCode:
Public Class Interpretermode { Public Void Main () {interpretercontext Context = New Interpretercontext (); ilist New List (); List. Add ( New Term
1 Intent: Given a language, define a representation of its grammar, and define an interpreter that uses that representation to interpret sentences in the language.2 motivation: If a particular type of problem occurs at a sufficiently high frequency, it might be worthwhile to describe each instance of the problem as a sentence in a simple language.Build an interpreter to explain these sentences to solve the
This article by larrylgq prepared, reproduced please note the Source: http://blog.csdn.net/larrylgq/article/details/7395261
Author: Lu guiqiang
Email: larry.lv.word@gmail.com
Lisp uses special operators to extend the syntax, but the number of special operators in lisp is fixed. To solve this problem, LISP introduces macros, which do not directly do th
Principle and Implementation interpreter mode of Atitit. linq java, atitit. linq Interpreter
Principles and implementation interpreter mode of Atitit. linq java
1. Implementation of Linq from where 1
2. Where expr Implementation 1
3. A variation of Attilax 2
4. interpreter mode structure 2
5. Code3
5.1. EqExpression3
Author: Chen Xi
Date: 11:31:12
Environment: [Mac 10.7.1 lion intel-based x64 gcc4.2.1 xcode4.2]
Reprinted please indicate the source
Q: What does the interpreter come from?
A: If it is a broad interpreter, you can understand it as a translator, as long as you can translate a thing that is regarded as original into what you need, processing can be called an interpreter
The php design mode is Interpreter (Interpreter mode). For more information, see.
Copy codeThe code is as follows:
/**
* Interpreter example
*
* @ Create_date: 2010-01-04
*/
Class Expression
{
Function interpreter ($ str)
{
Return $ str;
}
}
Class ExpressionNum extends Expression
{
Function
Copy CodeThe code is as follows:
/**
* Interpreter Example
*
* @create_date: 2010-01-04
*/
Class Expression
{
function Interpreter ($STR)
{
return $str;
}
}
Class Expressionnum extends Expression
{
function Interpreter ($STR)
{
Switch ($STR)
{
Case "0": Return "0";
Case "1": Return "one";
Case "2": Return "two";
Case "3": Return "three";
Case "4": Return "four";
Introduction to the Interpreter model (Brief Introduction)
The Interpreter mode (interpreter pattern), given a language, defines a representation of its grammar, and defines an interpreter that uses the representation to interpret a sentence in a language. With the interpreter
Python Interpreter: Part 1 function object, python InterpreterPython Interpreter: Part 1 function object
In the last three months, Ned Batchelder and I have spent a lot of time developing byterun. This project byterun (https://github.com/nedbat/byterun) is an interpreter for python bytecode developed using python. In the byterun process of the development
Interpreter The schema provides a framework for implementing a syntax interpreter that uses an interpreter to provide a user with an interpreter that defines the language syntax, and interprets the sentences in the language through this interpreter.
In Lisp, a list is a value pair. You can operate cons to create a value pair. For example, cons 1 2 and 1 and 2 are two values of the value pair. Cons operations are closures, so the elements that constitute the list can be atomic or list types, such as cons 1 (cons 2 3 )). The operations for reading the list include car And cdr, which are the "Left value" and "right value" of the read value pair, for example (car '(1 2), return 1, (cdr '(1 2) returns
This is a creation in
Article, where the information may have evolved or changed.
I'm not going to use prefix expressions specifically for Lisp to go online and look for articles or books advocating this. I'm not a fan of Lisp, either. Learning Lisp at first is nothing more than learning its great ideas.But when I slowly learned to
This is a created
article in which the information may have evolved or changed.
Last October, that was the plan.
Also in the last month or so, the time to get out of a go language implementation of Lisp.
Of course, not with Common Lisp, the number of functions is far inferior, also cannot define the type/class, and the macro system is very simple.
But in general, it is also the realization of the basic
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.