Microsoft MVP성태의 닷넷 이야기
.NET Framework: 562. BBI 인터프리터 C/C++ 코드를 C#으로 변환 [링크 복사], [링크+제목 복사],
조회: 29358
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
(연관된 글이 1개 있습니다.)

BBI 인터프리터 C/C++ 코드를 C#으로 변환

아래 글에 이어,

인터프리터 어휘 분석 프로그램 - C# 예제
; https://www.sysnet.pe.kr/2/0/10903

인터프리터 - 역폴란드 표기법을 이용한 식의 분석 - C# 예제
; https://www.sysnet.pe.kr/2/0/10904

인터프리터 - 재귀적 하향 구문 분석 C# 예제
; https://www.sysnet.pe.kr/2/0/10907

마지막으로,

만들면서 배우는 인터프리터: 컴파일러 이론으로 만드는 나만의 스크립트 언어 
; http://www.yes24.com/24/goods/7858784?scode=032

책의 BBI Interpreter C/C++ 소스 코드를 C#으로 변환한 것을 올립니다. 사용 방법은 다음과 같은 식입니다.

static void Main(string[] args)
{
    string text = File.ReadAllText("sample0.txt");

    Interpreter bbi = new Interpreter();

    bbi.Convert(text);
    bbi.SyntaxCheck();
    bbi.Execute();
}

비주얼 스튜디오에서 디버그 모드로 한줄 한줄 실행해 보면 눈에 들어오실 것입니다. ^^

(첨부한 파일은 소스 코드입니다.)




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]

[연관 글]






[최초 등록일: ]
[최종 수정일: 4/12/2024]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 



2016-03-18 08시47분
Sample 파일까지 친절히 넣어주셨네요 ^^
좋은 자료 감사합니다!
덕분에 인터프리터 약간이라도 이해를 했네요.
김선우
2016-03-18 02시37분
대부분의 C 코드 문법을 C#에 맞게 변환하느라 네이밍 룰이 엉망입니다. ^^; 그래도 분석하기에는 제가 변환한 C# 버전이 더 편안하지 않을까 싶어 올려 봤습니다. ^^
정성태
2023-04-27 09시14분
ScriptDOM .NET library for T-SQL parsing is now open source
; https://techcommunity.microsoft.com/t5/azure-sql-blog/scriptdom-net-library-for-t-sql-parsing-is-now-open-source/ba-p/3804284

-------------------------------

AZHenley/teenytinycompiler
; https://github.com/AZHenley/teenytinycompiler

Let's make a Teeny Tiny compiler, part 1
; https://austinhenley.com/blog/teenytinycompiler1.html

Let's make a Teeny Tiny compiler, part 2
; https://austinhenley.com/blog/teenytinycompiler2.html

Let's make a Teeny Tiny compiler, part 3
; https://austinhenley.com/blog/teenytinycompiler3.html
정성태

1  2  3  4  5  [6]  7  8  9  10  11  12  13  14  15  ...
NoWriterDateCnt.TitleFile(s)
13576정성태3/8/202413274닷넷: 2228. .NET Profiler - IMetaDataEmit2::DefineMethodSpec 사용법
13575정성태3/7/202414402닷넷: 2227. 최신 C# 문법을 .NET Framework 프로젝트에 쓸 수 있을까요?
13574정성태3/6/202413821닷넷: 2226. C# - "Docker Desktop for Windows" Container 환경에서의 IPv6 DualMode 소켓
13573정성태3/5/202411640닷넷: 2225. Windbg - dumasync로 분석하는 async/await 호출
13572정성태3/4/202411502닷넷: 2224. C# - WPF의 Dispatcher Queue로 알아보는 await 호출의 hang 현상파일 다운로드1
13571정성태3/1/202411452닷넷: 2223. C# - await 호출과 WPF의 Dispatcher Queue 동작 확인파일 다운로드1
13570정성태2/29/202413294닷넷: 2222. C# - WPF의 Dispatcher Queue 동작 확인파일 다운로드1
13569정성태2/28/202412572닷넷: 2221. C# - LoadContext, LoadFromContext 그리고 GAC파일 다운로드1
13568정성태2/27/202413190닷넷: 2220. C# - .NET Framework 프로세스의 LoaderOptimization 설정을 확인하는 방법파일 다운로드1
13565정성태2/23/202410581닷넷: 2219. .NET CLR2 보안 모델에서의 개별 System.Security.Permissions 제어
13561정성태2/20/202412747닷넷: 2218. C# - (예를 들어, Socket) 비동기 I/O에 대한 await 호출 시 CancellationToken을 이용한 취소파일 다운로드1
13558정성태2/18/202413411닷넷: 2217. C# - 최댓값이 1인 SemaphoreSlim 보다 Mutex 또는 lock(obj)를 선택하는 것이 나은 이유
13555정성태2/15/202412960닷넷: 2216. C# - SemaphoreSlim 사용 시 주의점
13553정성태2/14/202410421닷넷: 2215. windbg - thin/fat lock 없이 동작하는 Monitor.Wait + Pulse
13552정성태2/13/202410607닷넷: 2214. windbg - Monitor.Enter의 thin lock과 fat lock
13551정성태2/12/202412582닷넷: 2213. ASP.NET/Core 웹 응용 프로그램 - 2차 스레드의 예외로 인한 비정상 종료
13545정성태1/30/202413077닷넷: 2212. ASP.NET Core - 우선순위에 따른 HTTP/HTTPS 호스트:포트 바인딩 방법
13538정성태1/25/202411820닷넷: 2211. C# - NonGC(FOH) 영역에 .NET 개체를 생성파일 다운로드1
13537정성태1/24/202413365닷넷: 2210. C# - Native 메모리에 .NET 개체를 생성파일 다운로드1
13536정성태1/23/202412786닷넷: 2209. .NET 8 - NonGC Heap / FOH (Frozen Object Heap) [1]
13535정성태1/22/202414205닷넷: 2208. C# - GCHandle 구조체의 메모리 분석
13534정성태1/21/202412035닷넷: 2207. C# - SQL Server DB를 bacpac으로 Export/Import파일 다운로드1
13533정성태1/18/202412125닷넷: 2206. C# - TCP KeepAlive의 서버 측 구현파일 다운로드1
13532정성태1/17/202412385닷넷: 2205. C# - SuperSimpleTcp 사용 시 주의할 점파일 다운로드1
13531정성태1/16/202412714닷넷: 2204. C# - TCP KeepAlive에 새로 추가된 Retry 옵션파일 다운로드1
13530정성태1/15/202412472닷넷: 2203. C# - Python과의 AES 암호화 연동파일 다운로드1
1  2  3  4  5  [6]  7  8  9  10  11  12  13  14  15  ...