KR101339356B1 - Script Engine Control Device for the Automation of Graphic Builder - Google Patents

Script Engine Control Device for the Automation of Graphic Builder Download PDF

Info

Publication number
KR101339356B1
KR101339356B1 KR1020080108550A KR20080108550A KR101339356B1 KR 101339356 B1 KR101339356 B1 KR 101339356B1 KR 1020080108550 A KR1020080108550 A KR 1020080108550A KR 20080108550 A KR20080108550 A KR 20080108550A KR 101339356 B1 KR101339356 B1 KR 101339356B1
Authority
KR
South Korea
Prior art keywords
script
parser
statement
function
user
Prior art date
Application number
KR1020080108550A
Other languages
Korean (ko)
Other versions
KR20100049410A (en
Inventor
진민정
민인규
오의석
Original Assignee
현대중공업 주식회사
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 현대중공업 주식회사 filed Critical 현대중공업 주식회사
Priority to KR1020080108550A priority Critical patent/KR101339356B1/en
Publication of KR20100049410A publication Critical patent/KR20100049410A/en
Application granted granted Critical
Publication of KR101339356B1 publication Critical patent/KR101339356B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/23Pc programming
    • G05B2219/23067Control, human or man machine interface, interactive, HMI, MMI

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Stored Programmes (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

본 발명은 그래픽빌더의 자동화를 위한 스크립트 엔진 제어장치에 관한 것으로, 특히 사용자가 자유롭게 프로그램을 작성할 수 있고, 스크립트 명령을 해석할 수 있는 인터프리터를 내장하여 태그에 대한 다양한 연산과 논리적인 연산에 대한 그래픽 처리가 가능하도록 하는 효과를 기대할 수 있다.The present invention relates to a script engine control apparatus for automation of a graphic builder. In particular, a user can freely write a program and has a built-in interpreter capable of interpreting a script command. The effect of making it possible to process can be expected.

그래픽빌더, 스크립트 엔진, 자동제어, 스크립트 입력부, 스크립트 처리부, 스크립트 출력부 Graphic Builder, Script Engine, Automatic Control, Script Input Section, Script Processing Section, Script Output Section

Description

그래픽빌더의 자동화를 위한 스크립트 엔진 제어장치{Script Engine Control Device for the Automation of Graphic Builder}Script Engine Control Device for the Automation of Graphic Builder}

본 발명은 사용자가 자유롭게 프로그램을 작성할 수 있고, 스크립트 명령을 해석할 수 있는 인터프리터를 내장하여 태그에 대한 다양한 연산과 논리적인 연산에 대한 그래픽 처리가 가능하도록 한 그래픽빌더의 자동화를 위한 스크립트 엔진 제어장치에 관한 것이다.The present invention provides a script engine control apparatus for automation of a graphic builder that allows a user to freely write a program and has a built-in interpreter capable of interpreting a script command, thereby enabling graphic processing of various operations and logical operations on tags. It is about.

그래픽 빌더란 선박 및 육상용 상위 시스템을 개발하기 위하여 개발한 HMI(Human-Machine Interface) 개발 툴이다. 그래픽 빌더의 구성은 크게 편집기와 런타임으로 구분된다.Graphic Builder is a Human-Machine Interface (HMI) development tool developed to develop ship and land high-level systems. The composition of the Graphics Builder is largely divided into editor and runtime.

편집기의 주요 기능은 그리기 기능 및 심볼 등록, 정렬 기능을 이용하여 감시 및 제어에 필요한 화면을 제작하는 기능을 제공하고, 런타임은 편집기를 통하여 작성된 공정도 화면을 표시하고 설정된 동적 특성에 따라 제어를 수행하는 기능을 제공한다.The main function of the editor provides the function to create the screen necessary for monitoring and control by using the drawing function, symbol registration, and alignment function, and the runtime displays the process chart screen created through the editor and performs control according to the set dynamic characteristics. Provides the ability to

이러한 그래픽 빌더는 선박 및 육상용 상위 시스템을 사용자가 자유롭게 공정도 화면을 구성할 수 있는 그래픽 편집기 기능을 제공하고, 또한 그래픽 편집기 에서 작성하여 저장한 동적 특성들을 읽어 그 특성에 따라 제어를 수행하는 그래픽 빌더 런타임 기능을 제공한다.These graphic builders provide a graphic editor function that allows the user to freely configure the process diagram screen of the ship and onshore high-level systems, and also read and control the dynamic characteristics created and saved in the graphic editor and perform the control according to the characteristics. Provides builder runtime functionality.

그러나 기존 시스템은 사용자가 그래픽적인 요소들은 편집기를 이용하여 자유롭게 작성할 수 있지만, 실제로 동적으로 직접 제어하는 요소는 개발자가 런타임쪽에서 처리를 해줘야 하는 부분이기 때문에 제약요소를 가지고 있다.However, the existing system allows the user to freely create graphical elements by using an editor, but in reality, the elements that are directly controlled dynamically have limitations because the developer must handle them at runtime.

따라서, 상기 문제점을 해결하기 위한 본 발명은 사용자가 자유롭게 프로그램을 작성할 수 있는 기능으로 구현되어 있고, 스크립트 명령을 해석할 수 있는 인터프리터를 내장하여 태그에 대한 다양한 연산과 논리적인 연산에 대한 그래픽 처리가 가능하다. 예를 들면, 어떤 키를 눌렀을 때 윈도우가 열리거나 값이 바뀌는 동작과 타이머, 키보드, 태그 데이터의 값 변화 그리고 마우스의 클릭 등의 이벤트가 발생했을 때 수행하는 기능이 스크립트로 작성 가능하도록 한 그래픽빌더의 자동화를 위한 스크립트 엔진 제어장치를 제공함을 목적으로 한다.Accordingly, the present invention for solving the above problems is implemented as a function that allows a user to freely write a program, and has a built-in interpreter capable of interpreting script commands to perform graphics processing for various operations on a tag and logical operations. It is possible. For example, a graphic builder that allows scripts to be written when a key is pressed to open a window or change its value, and to perform actions when an event such as a timer, keyboard, tag data changes, or a mouse click occurs. It is an object of the present invention to provide a script engine controller for automation.

상기 목적달성을 위한 본 발명은 그래픽빌더의 자동화를 위한 스크립트 엔진 제어장치에 있어서, 개발자가 스크립트 사용자에게 제공하는 기본함수와 스크립트를 사용 중에, 사용자의 필요에 의해서 등록되는 사용자 제작 함수로 이루어지는 스크립트 함수와, 사용자가 작성하기 쉬우면서 원하는 위치에 원하는 기능을 제작할 수 있도록 C와 유사한 언어 형태를 가지며, if문, switch문, while문, for문, return문 등의 제어문 구조를 가지고, 논리 연산 및 사칙 연산을 지원하며, 지역 변수를 선언하여 임시 변수를 할당하고 사용할 수 있도록 설계된 스크립트 코드와, 전역 변수를 사용하기 위하여 우선적으로 전역 변수 선언란에 변수명, 변수형, 초기값을 선언하여 등록되고, integer형, double형, boolean형, string형의 변수를 지원하는 전역변수 테이블로 이루어진 스크립트 입력부와; 함수와 전역 변수/지역 변수, 그리고 작성한 스크립트 코드를 입력으로 받아 구문 실행 프로세서를 통하여 사용자 스크립트를 처리하는 스크립트 처리부와; 스크립트 처리부에서 처리된 결과를 출력하는 스크립트 출력부; 로 구성한 것을 특징으로 한다.The present invention for achieving the above object is a script engine control device for the automation of the graphic builder, a script function consisting of a user-created function registered by the user's needs while using the basic function and script provided by the developer to the script user And, it is easy to be written by the user and has the language form similar to C so that the user can make the desired function in the desired position, and has the control statement structure such as if statement, switch statement, while statement, for statement, and return statement. Script code designed to support the operation, assign local variables and use them by declaring local variables, and register variable names, variable types, and initial values in the global variable declaration field to use global variables. consists of a global variable table that supports variables of type, double, boolean, and string And the encrypted input; A script processing unit which receives a function, a global variable / local variable, and a written script code as an input and processes a user script through a syntax execution processor; A script output unit which outputs the result processed by the script processing unit; .

본 발명에 의하면, 사용자가 자유롭게 프로그램을 작성할 수 있고, 스크립트 명령을 해석할 수 있는 인터프리터를 내장하여 태그에 대한 다양한 연산과 논리적인 연산에 대한 그래픽 처리가 가능하도록 하는 효과를 기대할 수 있다.According to the present invention, the user can freely write a program, and by embedding an interpreter capable of interpreting a script command, it is possible to expect the effect of enabling graphic processing for various operations and logical operations on tags.

이하 첨부된 도면 도 1 내지 도 16 을 참조하여 본 발명의 바람직한 실시예를 설명하면 다음과 같다.Hereinafter, exemplary embodiments of the present invention will be described with reference to the accompanying drawings, FIGS. 1 to 16.

본 발명을 설명함에 있어서 정의되는 용어들은 본 발명에서의 기능을 고려하여 정의 내려진 것으로, 본 발명의 기술적 구성요소를 한정하는 의미로 이해되어서는 아니 될 것이다.The terms defined in describing the present invention have been defined in consideration of the functions of the present invention and should not be construed to limit the technical elements of the present invention.

상기 도면에 의하면 본 발명은, 그래픽빌더의 자동화를 위한 스크립트 엔진 제어장치에 있어서, 개발자가 스크립트 사용자에게 제공하는 기본함수와 스크립트를 사용 중에, 사용자의 필요에 의해서 등록되는 사용자 제작 함수로 이루어지는 스크립트 함수와, 사용자가 작성하기 쉬우면서 원하는 위치에 원하는 기능을 제작할 수 있도록 C와 유사한 언어 형태를 가지며, if문, switch문, while문, for문, return문 등의 제어문 구조를 가지고, 논리 연산 및 사칙 연산을 지원하며, 지역 변수를 선언하여 임시 변수를 할당하고 사용할 수 있도록 설계된 스크립트 코드와, 전역 변수를 사용하기 위하여 우선적으로 전역 변수 선언란에 변수명, 변수형, 초기값을 선언하여 등록되고, integer형, double형, boolean형, string형의 변수를 지원하는 전역변수 테이블로 이루어진 스크립트 입력부와; 함수와 전역 변수/지역 변수, 그리고 작성한 스크립트 코드를 입력으로 받아 구문 실행 프로세서를 통하여 사용자 스크립트를 처리하는 스크립트 처리부와; 스크립트 처리부에서 처리된 결과를 출력하는 스크립트 출력부; 로 구성한 것을 특징으로 한다.According to the drawings, the present invention, in the script engine control apparatus for the automation of the graphic builder, a script function consisting of a basic function provided by the developer to the script user and a user production function registered by the user's needs while using the script And, it is easy to be written by the user and has the language form similar to C so that the user can make the desired function in the desired position, and has the control statement structure such as if statement, switch statement, while statement, for statement, and return statement. Script code designed to support the operation, assign local variables and use them by declaring local variables, and register variable names, variable types, and initial values in the global variable declaration field to use global variables. A global variable table that supports variables of type, double, boolean, and string. Script and input; A script processing unit which receives a function, a global variable / local variable, and a written script code as an input and processes a user script through a syntax execution processor; A script output unit which outputs the result processed by the script processing unit; .

또한, 상기 스크립트 처리부는 스크립트 처리시 파서를 위하여 파서 노드를 선언하고, 인자로 스크립트의 스트링을 넘기는 순간, 생성자(Constructor)가 토크나이저와 파서를 호출하되, 상기 토그나이저는 스크립트 엔진에서 어휘 분석 단계이고, 파서는 구문 분석 단계인 것을 특징으로 하며,In addition, the script processing unit declares a parser node for a parser during script processing, and when a constructor passes a string of scripts as an argument, a constructor calls a tokenizer and a parser, and the tonizer performs a lexical analysis in a script engine. The parser is characterized in that the parsing step,

상기 토그나이저(어휘분석단계)는 입력부에 의해 입력된 스크립트 코드를 문자 단위로 읽어 들여 토큰으로 얻어내고 의미 단위로 쪼개어 파서에게 넘겨주는 것으로, 'n'은 캐리지 리턴(carriage return)을 의미하고, '\n'의 개수를 세어 해당 토큰이 몇번째 줄에 위치하는지에 대한 정보까지 함께 알아내며, 토큰 처리 방식은 C 표준 방식에 따라 앞에서부터 가장 큰 의미를 이루도록 토크나이징 처리하는 것을 특징으로 하며,The tokenizer (lexical analysis step) reads the script code input by the input unit in character units, obtains it as a token, splits it into semantic units, and hands it to the parser, 'n' means a carriage return, The number of '\n' is counted to find out the information on the line where the token is located, and the token processing method is characterized by the tokenizing process to achieve the greatest meaning from the front according to the C standard method. ,

상기 파서(구문분석단계)는 어휘 분석 단계를 통과하였을때 수행되는 것으로서, 어휘 분석 단계에서 생성한 토큰 정보를 기반으로 구문 분석을 수행하되, 문법 검사의 최소 단위가 체크되었는지 확인하고 리턴하는 기본 단위 체크(Base Case Check)단계: if문, for문, while문, return문, switch문 등의 예약어인지를 판별하 고, 각각에 해당하는 예약어 파서를 호출하며, 그 외의 경우 ';'를 체크하여 각각 자기 자신을 호출하는 구문 체크단계: 상기 구문 체크단계에 걸리지 않으면 함수(또는 수식)로 판단하고 함수 파서를 호출하는 함수 파싱단계: 구문체크단계에서 처리한 후, 이를 각각의 예약어 파서에 맞는 문법에 따라 파싱하는 예약어 파서단계: 연산자 우선 순위에 따라 적절한 모양으로 트리를 파싱하는 함수 파서단계: 로 이루어지는 것을 특징으로 한다.The parser (parsing step) is performed when passing the lexical analysis step, and performs parsing based on the token information generated in the lexical analysis step, but checks whether the minimum unit of grammar checking is checked and returns the basic unit Base Case Check step: Determines whether a reserved word such as an if statement, a for statement, a while statement, a return statement, a switch statement, etc., calls each reserved word parser, and checks ';' in other cases. Syntax checking step to call each one: If it does not pass the above syntax checking step, it is determined as a function (or formula). Function parsing step: Calling a function parser: After processing in the syntax checking step, it is a syntax suitable for each reserved word parser. A reserved word parser step of parsing according to: a function parser step of parsing a tree in an appropriate shape according to operator priority.

본 발명에서 제공하는 스크립트 엔진은 사용자가 프로그램을 외부에서 작성하고, 동작시켜 자유 자재로 프로그램을 활용할 수 있는 편의를 제공하기 위해 개발되었다.The script engine provided by the present invention was developed to provide a convenience that a user can freely utilize the program by writing and operating the program externally.

제안하는 스크립트 엔진은 사용자가 자유롭게 프로그램을 작성할 수 있는 기능으로 구현되어 있고, 스크립트 명령을 해석할 수 있는 인터프리터를 내장하여 태그에 대한 다양한 연산과 논리적인 연산에 대한 그래픽 처리가 가능하다.The proposed script engine is implemented as a function that a user can freely write a program, and it has a built-in interpreter that can interpret script commands, and can perform graphic processing on various operations on tags and logical operations.

예를 들면, 어떤 키를 눌렀을 때 윈도우가 열리거나 값이 바뀌는 동작과 타이머, 키보드, 태그 데이터의 값 변화 그리고 마우스의 클릭 등의 이벤트가 발생했을 때 수행하는 기능이 스크립트로 작성 가능하다.For example, you can write a script that opens a window or changes its value when a key is pressed, and what happens when an event such as a timer, keyboard, tag data changes, or a mouse click occurs.

스크립트 엔진의 주요 부분은 스크립트입력부, 스크립트처리부, 스크립트처리부로 구분된다.The main parts of the script engine are divided into script input unit, script processing unit, and script processing unit.

◆스크립트 입력부◆Script input section

스크립트 엔진의 스크립트 입력부는 도 1 에 도시된 바와같이 크게 3가지로 구분된다.The script input unit of the script engine is classified into three types as shown in FIG. 1.

1. 스크립트 함수: 스크립트 함수는 기본함수와 사용자 제작 함수로 나뉘는데, 기본함수란 개발자가 스크립트 사용자에게 제공하는 함수로서 일반적으로 윈도우 컴포넌트를 제어할 수 있는 윈도우 함수, 시간함수 등과 같은 시스템 관련 함수, 그리고 연산을 위한 수학 함수 및 데이터 베이스 지원 함수 등을 말한다. 사용자 제작 함수란, 스크립트를 사용 중에, 사용자의 필요에 의해서 등록되는 함수를 말한다.1. Script functions: Script functions are divided into basic functions and user-created functions. Basic functions are functions that developers provide to script users. Generally, system-related functions such as window functions, time functions, etc., which can control window components, and Refers to mathematical functions and database support functions for operations. A user-created function is a function that is registered as needed by a user while using a script.

2. 스크립트 코드: 발명한 스크립트는 C와 유사한 언어 형태를 가지며, if문, switch문, while문, for문, return문 등의 제어문 구조를 가지고, 논리 연산 및 사칙 연산을 지원한다. 또한 지역 변수를 선언하여 임시 변수를 할당하고 사용할 수 있도록 설계되었다. 스크립트 사용자는 작성하기 쉬운 스크립트 코드를 사용하여 원하는 위치에 원하는 기능을 제작할 수 있다.2. Script code: Invented script has a language similar to C and has control statement structure such as if statement, switch statement, while statement, for statement, and return statement, and supports logical operation and arithmetic operation. It is also designed to allow local variables to be assigned and used by declaring local variables. Script users can use script code that is easy to write to create the desired functionality in the desired location.

3. 전역 변수 테이블: 전역 변수를 사용하기 위하여 우선적으로 전역 변수 선언란에 변수명, 변수형, 초기값을 선언하여 등록해야 한다. 지원하는 변수는 기본적인 integer형, double형, boolean형, string형을 지원하며, COLORREF형을 지원하기 위하여 unsigned long형을 추가로 지원한다.3. Global Variable Table: To use a global variable, you must first declare and register the variable name, variable type, and initial value in the global variable declaration field. Supported variables support basic integer type, double type, boolean type and string type, and additionally support unsigned long type to support COLORREF type.

◆스크립트 처리부◆◆ Script processing department ◆

스크립트 처리부는 코어 엔진이라고도 불리운다.The script processing unit is also called the core engine.

스크립트처리부의 핵심인 스크립트 엔진 코어는 스크립트입력부의 함수와 전역 변수/지역 변수, 그리고 작성한 스크립트 코드를 입력으로 받아 구문 실행 프로세서를 통하여 사용자 스크립트를 처리한다.The script engine core, which is the core of the script processing unit, takes as input the functions of the script input unit, global variables / local variables, and the script code that is created, and processes the user script through the syntax execution processor.

파서를 위하여 파서 노드를 선언하고, 인자로 스크립트의 스트링을 넘기는 순간, 생성자(Constructor)가 토크나이저와 파서를 호출한다.Declare a parser node for the parser and pass a string of scripts as arguments. The constructor calls the tokenizer and parser.

도 2 는 스크립트엔진의 전체 구조를 도식화 한 것이다.2 illustrates the overall structure of a script engine.

토그나이저는 스크립트 엔진에서 어휘 분석 단계를 말하며, 파서는 구문 분석 단계를 말한다.The tokenizer refers to the lexical analysis stage in the script engine, and the parser refers to the parsing stage.

이하 토그나이저와 파서의 처리 과정을 간략하게 설명한다.The following describes the process of processing the toner and parser briefly.

(1)토그나이저(어휘 분석)(1) tokenizer (lexical analysis)

토그나이저(어휘분석)는 스크립트 입력부를 통해 작성된 스크립트 코드를 문자 단위로 읽어 들여 토큰으로 얻어내고 의미 단위로 쪼개어 파서에게 넘겨주는 역할을 한다. 'n'는 캐리지 리턴(carriage return)을 의미하는데, '\n'의 개수를 세어 해당 토큰이 몇번째 줄에 위치하는지에 대한 정보까지 함께 알아낸다.Tokenizer (lexical analysis) reads the script code written through the script input unit in character units, obtains it as a token, splits it into semantic units, and passes it to the parser. 'n' means carriage return, which counts the number of 'n's together to find out on which line the token is located.

토큰 처리 방식은 C 표준 방식에 따라 앞에서부터 가장 큰 의미를 이루도록 토크나이징하였다.The token processing method was tokenized to have the greatest meaning from the beginning according to the C standard method.

토그나이저 과정에서 만약 에러를 발견하였거나, 에러로 판별하였을 경우 에러 테이블에 추가한다.If an error is found or found as an error in the tokenizer, it is added to the error table.

만약 토그나이저과정에서 에러가 발견되지 않았다면, 파서 단계로 넘어간다.If no errors were found during the tokenizer, go to the parser step.

그러나 에러가 발견되면, 실행을 중단하고 발견된 에러 메시지를 사용자에게 알린다.However, if an error is found, it stops running and notifies the user of the error message found.

도 3은 토그나이저(어휘 분석 처리 과정)을 도식화하여 도시한 것이다.3 shows a schematic diagram of a tonizer (lexical analysis process).

(2)파서(구문 분석)(2) parser (parse)

상기 토그나이저(어휘 분석 단계)를 통과하면, 파서(구문분석 단계)를 수행하는데, 어휘 분석 단계에서 생성한 토큰 정보를 기반으로 구문 분석을 수행한다.When passing through the tokenizer (lexical analysis step), a parser (syntax analysis step) is performed, and syntax analysis is performed based on token information generated in the lexical analysis step.

이때, 토큰 시퀀스를 받아서 파서 트리를 구성한다. 어휘 분석 과정에서의 에러는 단순히 작성한 스크립트 언어가 문법에 맞게 작성이 되었는지에 대한 검사를 수행하지만, 구문 분석에서의 에러는 실제로 사용해야 하는 함수 이름이 틀렸거나, 공백과 같이, 어휘 분석에서 발견할 수 없는 에러, 즉 스크립트 실행에 있어서 문법적 오류가 있으면, 에러 테이블에 추가하고, 에러가 없으면 구문 분석 프로세스가 수행된다.At this time, the token sequence is received to construct a parser tree. Errors in lexical analysis simply check that the scripting language you have written is grammatically correct, but errors in parsing can be found in lexical analysis, such as incorrect function names or spaces. If there are no errors, that is, grammatical errors in the execution of the script, they are added to the error table. If there are no errors, the parsing process is performed.

구문 분석 단계에서는 Top-down 방식의 recursive call을 통한 파싱을 수행하는데, 토큰 벡터를 넘겨주면서 파싱해야 할 부분의 인덱스를 바꾸어 가며 호출한다.In the parsing phase, parsing is performed through the top-down recursive call. It is called by changing the index of the part to be parsed while passing the token vector.

도 4는 파서(구문 분석) 처리과정을 도식화 도면이다.4 is a diagram illustrating a parser (syntactic analysis) process.

파서 처리 과정은 다음과 같다.The parser process is as follows:

기본 단위 체크(Base Case Check)단계로서, 문법 검사의 최소 단위가 체크되었는지 확인하고 리턴하며, 구문 체크단계로서, if문, for문, while문, return문, switch 문 등의 예약어인지를 판별하고, 각각에 해당하는 예약어 파서를 호출한다. 그 외의 경우 ';'을 체크하여 각각 자기 자신을 호출한다.As a base case check step, it checks whether the minimum unit of grammar check is checked and returns. As a syntax check step, it determines whether it is a reserved word such as if statement, for statement, while statement, return statement, and switch statement. Invoke the corresponding reserved word parser. Otherwise, each call itself by checking ';'.

그리고, 함수 파싱 단계로서, 위의 구문 체크단계에 걸리지 않으면 함수(또는 수식)로 판단하고 함수 파서를 호출한다.As a function parsing step, if the above syntax checking step is not performed, it is determined as a function (or an expression) and the function parser is called.

구문체크에서 처리한 후, 이를 각각의 예약어 파서에 맞는 문법에 따라 파싱 처리하여 예약어 파서 단계를 처리한다. 각 예약어에 따라 생성되는 트리는 다르다.After processing in the syntax check, it processes the reserved word parser by parsing it according to the grammar for each reserved word parser. The tree created for each reserved word is different.

마지막으로 연산자 우선 순위에 따라 적절한 모양으로 트리를 파싱하는 함수파서 단계를 처리한다.Finally, it takes care of the function parser step, which parses the tree into the appropriate shape based on operator precedence.

◆스크립트 출력부◆Script output

스크립트 처리부인 엔진의 코어 구조와 스크립트출력부는 도 5 와 같이 구성된다.The core structure of the engine as the script processing unit and the script output unit are configured as shown in FIG.

스크립트 처리부에서 처리된 결과는 스크립트 출력부로 출력된다.The result processed by the script processing unit is output to the script output unit.

그래픽 빌더에서는 5가지 속성의 스크립트를 지원하며, 특히 동적 속성 스크립트에는 수많은 결과 처리가 필요하다.Graphic Builder supports scripting of five attributes, especially dynamic attribute scripts, which require a lot of processing.

스크립트가 적용되는 인스턴스에 따라 결과값이 대입되며, 이는 복잡한 처리과정과 다중 스크립트를 지원할 때 스크립트 관리 구조가 필요하다.Results are assigned based on the instance to which the script is applied, which requires a script management structure to support complex processing and multiple scripts.

스크립트 언어는 C++과 같은 문법을 가지되, 애매함을 줄이기 위하여 스크립트 문법으로 구성하였으며, if/for/while/switch/return/continues/break와 같은 예약어를 지원하며 조건식으로는 ==, !=, > , <, <=, >=, &&, || 등의 연산식을 제공한다. 기타 세부 스크립트 언어의 내용은 범위가 많아 생략한다.The scripting language has the same syntax as C ++, but is composed of scripting syntax to reduce ambiguity, and supports reserved words such as if / for / while / switch / return / continues / break and the conditional expressions ==,! =,> , <, <=,> =, &&, || Provides an expression such as The contents of other detailed scripting languages are large and are omitted.

상기 설명과 같은 스크립트 엔진에서 스크립트 입력부를 사용자에게 편리하고 명확하게 제공하기 위하여 스크립트 편집기가 필요하다.In the script engine as described above, a script editor is required to provide a user with a script input unit conveniently and clearly.

그래픽 빌더 스크립트 편집기에서 스크립트를 작성하는 부분은 도 6 과 같은 입력창을 제공하며, 사용자는 스크립트 작성부에서 제어 문법과 제공하는 함수를 사용하여 변경을 원하는 프로그램의 전체 컴파일을 하지 않고, 이 입력창을 통하여 각 동적 요소들을 제어하게 된다.In the graphic builder script editor, the script writing part provides an input window as shown in FIG. 6, and the user does not need to compile the entire program using the control syntax and the functions provided by the script writing part. You control each dynamic element through.

먼저, 사용자는 ⑤전역 변수 등록부에서 ②스크립트 작성부에서 사용할 전역 변수를 이름, 변수형, 초기값으로 선언한다. 또한, 사용자가 작성 중에 새로 만들고자 하는 함수가 있다면, ⑥사용자 함수 등록부에서 새로운 함수를 선언하고 작성한다.First, the user declares the global variable in the ⑤ global variable register by name, variable type, and initial value. Also, if a user wants to create a new function while writing, ⑥ declare and write a new function in the user function register.

④태그 등록부는 프로젝트에서 사용될 공유 메모리에 있는 태그 리스트를 로딩하여, 선택할 수 있는 창을 제공한다. 태그를 이용하여 논리 연산을 수행하여 스크립트 결과를 출력하게 되므로 중요한 기능이다.④ The tag registration unit loads the tag list in the shared memory to be used in the project and provides a window for selection. This function is important because it outputs script result by performing logical operation using tag.

작성이 완료되면, ①스크립트 메뉴에서 제공하는 문법 체크 기능 및 실행 기능에서 먼저, 문법 검사 기능을 하는데, 만약 문법적 오류를 발견하면, 에러 메시지가 메시지 박스형태로 뜰 것이고, 에러가 없으면, 바로 실행 버튼을 눌러서 수행한다.When the writing is completed, the grammar check function and the execution function provided in the script menu are first checked. If a grammatical error is found, an error message is displayed in the form of a message box. Press to execute.

결과는 ③결과 표시부에 표시하거나, 바로 스크립트를 작성하는 해당 컴포넌트에 런타임 실행시 적용된다.The result is displayed in the result display part or applied at runtime to the component that creates the script.

본 스크립트 편집기는 도움말 기능을 제공하여, 사용자가 프로그램작성에 익숙하지 않아도 제작할 수 있는 문법 설명, 예시, 제공함수 구조 및 작성 방법을 지원하여 편리성을 강화하였다.This script editor provides the help function to enhance convenience by supporting grammar explanation, example, provided function structure and writing method that users can make even if they are not familiar with program writing.

도 7은 개발한 스크립트 편집기의 화면을 나타내며, 도 8은 태그 등록부에서 실행 버튼을 눌렀을 때, 팝업되는 태그 등록 화면을 나타낸다. 또한, 도 9는 사용 자 등록 함수의 실행 버튼을 눌렀을 때 팝업되는 창을 나타낸 것이다.7 illustrates a screen of the developed script editor, and FIG. 8 illustrates a tag registration screen that is popped up when an execution button is pressed in the tag registration unit. 9 illustrates a window that pops up when the execution button of the user registration function is pressed.

이하, 본 발명의 적용 사례와 동작 방법을 설명한다.Hereinafter, application examples and operation methods of the present invention will be described.

적용 사례를 설명하기 위하여, 실제 그래픽 빌더의 런타임 모듈에 적용하고 비주얼한 효과를 실험하기 위하여 윈도우 컨트롤 등을 제어하는 동작 방법에 대해서 설명한다.In order to explain the application case, it explains how to control the window control etc. to apply to the runtime module of the graphic builder and to experiment with visual effects.

도 10은 테스트를 위하여 실제 런타임 모듈에 스크립트 엔진을 탑재한 화면을 나타내었다. 화면에서 보여지고 있는 각 윈도우 컨트롤은 사용자가 스크립트 에디터를 통해서 제작된 스크립트의 결과에 따라 각각 다르게 반영된다.10 illustrates a screen in which a script engine is mounted on an actual runtime module for testing. Each window control shown on the screen is reflected differently depending on the result of the script created by the user through the script editor.

만약, 문법 체크에서 오류가 안났을 경우는 도 11과 같은 메시지가 뜨며, 문법 검사를 하다, 에러가 발생하면, 에러 테이블에 저장된 에러 메시지를 출력한다.If an error is not found in the grammar check, a message as shown in FIG. 11 appears and a grammar check is performed. If an error occurs, the error message stored in the error table is output.

도 12는 에러 메시지 출력 창이다.12 is an error message output window.

도 13은 getcolor()함수를 통해서 실행되는 색상 창이며, 도 14는 위 스크립트 제어 함수를 통하여 태그값의 논리 연산에 의해서 수행되는 결과를 나타내었다.FIG. 13 is a color window executed through the getcolor () function, and FIG. 14 shows a result performed by a logical operation of a tag value through the above script control function.

현재까지 개발된 스크립트 함수는 크게, 윈도우 제어 함수와 Math함수, 태그 제어 함수, 윈도우 컴포넌트 제어함수 등을 제공한다.Script functions developed so far provide window control functions, Math functions, tag control functions, and window component control functions.

윈도우 제어 함수는 print, mbox, localtime, window, dialog, getcolor, play, srand, time, rand, CreatePath 등의 기본 함수를 제공한다. 여기서 모달 다이얼로그는 dialog() 함수를 통하여 제공되고, 모달리스 다이얼로그는 window()함수를 통해 제공된다.Window control functions provide basic functions such as print, mbox, localtime, window, dialog, getcolor, play, srand, time, rand, and CreatePath. Here a modal dialog is provided through the dialog () function, and a modal dialog is provided through the window () function.

Math 함수는 nsum, nminus, nmultiply, ndivide, dsum, abs, atoi, atof, cos, sin, tan 등의 기본 함수를 제공하며, 태그 제어함수는 GetTagValue를 통하여 실수형의 태그값을 공유 메모리로부터 읽어 들인다.The Math function provides basic functions such as nsum, nminus, nmultiply, ndivide, dsum, abs, atoi, atof, cos, sin, tan, etc. The tag control function reads a real tag value from shared memory through GetTagValue. .

윈도우 컴포넌트 제어 함수는 SetPositionSize, SetSliderPosition, SetFontSize, SetCaption, SetTextColor, SetBackColor, SetFontStatic, SetAddString, SetDeleteString, SetSliderdPosition 등의 컴포넌트 속성에 따라 다양한 함수를 제공하며, 사용자는 컴포넌트 속성에 따라 맞는 함수를 선택하여 적용하면 된다.The window component control functions provide various functions according to component properties such as SetPositionSize, SetSliderPosition, SetFontSize, SetCaption, SetTextColor, SetBackColor, SetFontStatic, SetAddString, SetDeleteString, and SetSliderdPosition. .

사용자 함수는 사용자가 스크립트 제공함수 이외에 새로운 함수를 만들고 싶을 경우에 필요한 기능이다. 본 스크립트 에디터는 사용자 함수 정의 기능을 제공한다.User functions are necessary when a user wants to create a new function in addition to a script providing function. This script editor provides the user function definition function.

사용자 정의 함수를 만들기 위하여, 먼저 사용자는 스크립트 에디터 창에서 리턴값이 정수형인 SUM이라는 사용자 함수를 정의한다. 그리고, Add /Modify Function 버튼을 누르면 그림 15와 같이 사용자 함수 제작창이 팝업된다. 여기서, SUM 계산에 사용될 정수형의 전역변수 2개, a와 b를 선언하고 코드는 return(a+b);를 제작하고 문법검사, 실행을 시키고 함수를 등록한다.To create a user-defined function, you first define a user function named SUM whose return value is an integer in the script editor window. If you press the Add / Modify Function button, the user function creation window pops up as shown in Figure 15. Here, we declare two integer global variables, a and b, to be used for SUM calculation, and the code produces return (a + b) ;, checks the syntax, executes it, and registers a function.

그러면, 실제 사용자는 자신이 등록한 함수를 스크립트 에디터에서 자유자재로 사용할 수 있다.Then, the actual user can freely use the registered function in the script editor.

도 16은 사용자 정의 함수의 결과를 보여준다. 우측 하단에서 알 수 있듯이, SUM이라는 2개의 Arguments가 등록되고, 리턴값이 정수형인 SUM함수라 도 15와 같이 정의되어 있으면, 사용자는 실제로 좌측 상단의 코드에서 Print문 내부의 코드 처럼 사용하게 되어, Result에서 결과값이 정확함을 확인 할 수 있다.16 shows the result of the user defined function. As you can see from the bottom right, if two Arguments called SUM are registered, and the return value is an integer SUM function defined as in Fig. 15, the user will actually use the code inside the Print statement in the upper left code. You can confirm that the result is correct in Result.

상기 설명과 같은 본 발명에 의하면, 선박 및 육상 HMI를 개발하기 위한 그래픽 빌더에 적용하여, 사용자가 기존 공정도 그래픽 제작뿐만 아니라, 자동 제어 기능도 자유롭게 작성하여 적용 가능하도록 할 수 있고, 이는 기존의 수동적인 그래픽 빌더 구조에서 자동화 스크립트 기능이 추가되어 한층 업그레이드된 기술력으로 제품의 경쟁력을 높일 것이다.According to the present invention as described above, by applying to a graphic builder for developing a ship and onshore HMI, the user can freely create and apply not only the existing process diagram graphics, but also automatic control function, which is a conventional Automation scripts have been added to the passive graphic builder structure to further enhance the product's competitiveness with its upgraded technology.

도 1 은 본 발명의 스크립트 엔진구조를 나타낸 도면.1 is a diagram showing a script engine structure of the present invention.

도 2 는 본 발명의 스크립트 전체구조를 나타낸 도면.2 is a diagram showing the overall structure of the script of the present invention.

도 3 은 본 발명에 적용된 스크립트 처리부의 토크나이저과정을 보인 도면.3 is a view showing a tokenizer process of the script processing unit applied to the present invention.

도 4 는 본 발명에 적용된 스크립트 처리부의 파서과정을 보인 도면.4 is a view showing a parser process of the script processing unit applied to the present invention.

도 5 는 본 발명 스크립트 엔진의 스크립트 처리부와 스크립트 출력부를 나타낸 도면.5 is a diagram illustrating a script processing unit and a script output unit of the script engine of the present invention.

도 6 은 스크립트 편집기를 나타낸 설계도.6 is a schematic diagram illustrating a script editor.

도 7 은 스크립트 편집기의 실제화면을 나타낸 도면.7 shows an actual screen of the script editor.

도 8 은 스크립트 편집기에 의한 태그 등록화면을 나타낸 도면.8 is a diagram illustrating a tag registration screen by a script editor.

도 9 는 스크립트 편집기에 의한 사용자 함수 등록화면을 나타낸 도면.9 is a view showing a user function registration screen by a script editor.

도 10 은 테스트를 위하여 실제 런타임 모듈에 스크립트 엔진을 탑재한 화면을 나타낸 도면.10 is a diagram showing a screen in which a script engine is mounted on an actual runtime module for testing.

도 11 은 문법체크시 오류가 발생하지 않았을때 화면출력상태를 나타낸 도면.11 is a diagram illustrating a screen output state when no error occurs during grammar checking.

도 12 는 문법체크시 오류가 발생하였을때 화면출력상태를 나타낸 도면.12 is a diagram illustrating a screen output state when an error occurs during grammar checking.

도 13 은 getcolor()함수를 통해 실행되는 색상 팝업창을 예시한 도면.13 illustrates a color popup window executed through a getcolor () function.

도 14 는 스크립트 제어함수를 통해 태그값의 논리연산에 의해서 수행되는 결과를 나타낸 도면.14 is a view showing a result performed by a logical operation of a tag value through a script control function.

도 15 는 사용자 정의함수 제작창을 나타낸 도면.15 illustrates a user-defined function creation window.

도 16 은 사용자 정의함수 사용결과를 나타낸 도면.16 is a view showing a result of using a user-defined function.

Claims (4)

그래픽빌더의 자동화를 위한 스크립트 엔진 제어장치에 있어서,In the script engine controller for the automation of the graphic builder, 개발자가 스크립트 사용자에게 제공하는 기본함수와 스크립트를 사용 중에,사용자의 필요에 의해서 등록되는 사용자 제작 함수로 이루어지는 스크립트 함수와, 사용자가 작성하기 쉬우면서 원하는 위치에 원하는 기능을 제작할 수 있도록 C와 유사한 언어 형태를 가지며, if문, switch문, while문, for문, return문 등의 제어문 구조를 가지고, 논리 연산 및 사칙 연산을 지원하며, 지역 변수를 선언하여 임시 변수를 할당하고 사용할 수 있도록 설계된 스크립트 코드와, 전역 변수를 사용하기 위하여 우선적으로 전역 변수 선언란에 변수명, 변수형, 초기값을 선언하여 등록되고, integer형, double형, boolean형, string형의 변수를 지원하는 전역변수 테이블로 이루어진 스크립트 입력부와; 함수와 전역 변수/지역 변수, 그리고 작성한 스크립트 코드를 입력으로 받아 구문 실행 프로세서를 통하여 사용자 스크립트를 처리하는 스크립트 처리부와; 스크립트 처리부에서 처리된 결과를 출력하는 스크립트 출력부; 로 구성하고,While using the basic functions and scripts provided by the developer to the script user, script functions consisting of user-written functions registered according to the user's needs, and C-like languages so that the user can easily write the desired functions in the desired location. It has a form, has control statement structure such as if statement, switch statement, while statement, for statement, and return statement, supports logical operation and arithmetic operation, and is a script code designed to assign and use temporary variable by declaring local variable. In order to use global variables, the script input section consists of a global variable table that first registers the variable name, variable type, and initial value in the global variable declaration field, and supports variables of type integer, double, boolean, and string. Wow; A script processing unit which receives a function, a global variable / local variable, and a written script code as an input and processes a user script through a syntax execution processor; A script output unit which outputs the result processed by the script processing unit; Consists of, 상기 스크립트 처리부는 스크립트 처리시 파서를 위하여 파서 노드를 선언하고, 인자로 스크립트의 스트링을 넘기는 순간, 생성자(Constructor)가 토그나이저와 파서를 호출하되, 상기 토그나이저는 스크립트 엔진에서 어휘 분석 단계이고, 파서는 구문 분석 단계인 것을 특징으로 하는 그래픽빌더의 자동화를 위한 스크립트 엔진 제어장치.The script processing unit declares a parser node for a parser during script processing and passes a string of scripts as an argument, the constructor calls the tokenizer and the parser, and the toner is a lexical analysis step in a script engine. The parser is a script engine controller for the automation of the graphics builder, characterized in that the parsing step. 삭제delete 제 1 항에 있어서, 상기 토그나이저(어휘분석단계)는 입력부에 의해 입력된 스크립트 코드를 문자 단위로 읽어 들여 토큰으로 얻어내고 의미 단위로 쪼개어 파서에게 넘겨주는 것으로,The method of claim 1, wherein the tonizer (lexical analysis step) is to read the script code input by the input unit by character unit to obtain a token and split it into semantic units to pass to the parser, 'n'은 캐리지 리턴(carriage return)을 의미하고, '\n'의 개수를 세어 해당 토큰이 몇번째 줄에 위치하는지에 대한 정보까지 함께 알아내며, 토큰 처리 방식은 C 표준 방식에 따라 앞에서부터 가장 큰 의미를 이루도록 토크나이징 처리하는 것을 특징으로 하는 그래픽빌더의 자동화를 위한 스크립트 엔진 제어장치.'n' means carriage return, and counts the number of '\'s together to find out which line the token is on, and the token processing method is based on the C standard. Scripting engine control device for the automation of the graphics builder, characterized in that the processing to achieve the greatest meaning. 제 1 항에 있어서,The method of claim 1, 상기 파서(구문분석단계)는 어휘분석단계를 통과하였을때 수행되는 것으로, 상기 어휘분석단계에서 생성한 토큰 정보를 기반으로 구문분석을 수행하되,The parser (syntax analysis step) is performed when passing the lexical analysis step, and performs a syntax analysis based on the token information generated in the lexical analysis step, 문법검사의 최소단위가 체크되었는지 확인하고 리턴하는 기본단위체크(Base Case Check)와; if문, for문, while문, return문, switch 문의 예약어인지를 판별하면서 각각에 해당하는 예약어 파서를 호출하며 그 외의 경우 ';'를 체크하여 각각 자기 자신을 호출하는 구문체크와; 상기 구문체크에 걸리지 않으면 함수(또는 수식)로 판단하고 함수 파서를 호출하는 함수파싱과; 구문체크에서 처리한 후 이를 각각의 예약어 파서에 맞는 문법에 따라 파싱하는 예약어 파서; 및, 연산자 우선 순위에 따라 적절한 모양으로 트리를 파싱하는 함수 파서; 가 이루어지는 것을 특징으로 하는 그래픽빌더의 자동화를 위한 스크립트 엔진 제어장치.A base case check for checking and returning that the minimum unit of the grammar check is checked; a syntax check for calling a reserved word parser corresponding to each of them while determining whether they are reserved words in an if statement, for statement, while statement, return statement, and switch statement, and otherwise calling each of them by checking ';'; A function parsing function that determines a function (or expression) and calls a function parser if the syntax check does not occur; A reserved word parser that processes the syntax check and parses it according to the grammar for each reserved word parser; And a function parser for parsing the tree in an appropriate shape according to the operator priority. Script engine control device for the automation of the graphics builder, characterized in that made.
KR1020080108550A 2008-11-03 2008-11-03 Script Engine Control Device for the Automation of Graphic Builder KR101339356B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020080108550A KR101339356B1 (en) 2008-11-03 2008-11-03 Script Engine Control Device for the Automation of Graphic Builder

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020080108550A KR101339356B1 (en) 2008-11-03 2008-11-03 Script Engine Control Device for the Automation of Graphic Builder

Publications (2)

Publication Number Publication Date
KR20100049410A KR20100049410A (en) 2010-05-12
KR101339356B1 true KR101339356B1 (en) 2014-01-02

Family

ID=42275866

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020080108550A KR101339356B1 (en) 2008-11-03 2008-11-03 Script Engine Control Device for the Automation of Graphic Builder

Country Status (1)

Country Link
KR (1) KR101339356B1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118012413B (en) * 2024-04-09 2024-06-11 西安衍舆航天科技有限公司 Satellite remote control operation script editing method and system based on graphics

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
카달로그1:BROADWIN TECHNOLOGY INC. *

Also Published As

Publication number Publication date
KR20100049410A (en) 2010-05-12

Similar Documents

Publication Publication Date Title
EP3005089B1 (en) Resolution of textual code in a graphical hierarchical model of a technical computing environment
Voelter et al. mbeddr: Instantiating a language workbench in the embedded software domain
EP2530583B1 (en) Computer-implemented method, system and computer program product for displaying a user interface component
Anderson et al. Experience report: Developing the Servo web browser engine using Rust
Perez et al. Bridging the GUI gap with reactive values and relations
Hay-Schmidt et al. Towards a unified language architecture for reversible object-oriented programming
Pech Jetbrains mps: Why modern language workbenches matter
US8434071B2 (en) Method for translating a graphical workflow in a textual description
Savic et al. Use case specification at different levels of abstraction
KR101339356B1 (en) Script Engine Control Device for the Automation of Graphic Builder
Mali et al. Building extensible specifications and implementations of Promela with AbleP
Blouin et al. Interacto: A Modern User Interaction Processing Model
Renggli Dynamic language embedding with homogeneous tool support
Chaubey et al. The integrated development environment (IDE) for application development: Android studio and its tools
Śmiałek et al. From Requirements to Java in a Snap
McNamara Rust in Action
Wąsowski et al. Internal Domain-Specific Languages
Clark et al. Beyond annotations: A proposal for extensible java (xj)
Renggli Dynamic Language Embedding
Kumar Fluent React
Sarstedt et al. A New Approach to Combine Models and Code in Model Driven Development.
US11972237B1 (en) Member invocation declarative interception
Yiu Checkstyle for Legacy Applications [J]
CN117075907B (en) Application program compiling method, system, compiler and storage medium
Buit Developing an easy-to-use query language for verification of lighting systems

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20161128

Year of fee payment: 4

LAPS Lapse due to unpaid annual fee