From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Apr 10 04:50:02 2007 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E88E816A404 for ; Tue, 10 Apr 2007 04:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id C8C5313C483 for ; Tue, 10 Apr 2007 04:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l3A4o2ap022235 for ; Tue, 10 Apr 2007 04:50:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l3A4o2F3022234; Tue, 10 Apr 2007 04:50:02 GMT (envelope-from gnats) Resent-Date: Tue, 10 Apr 2007 04:50:02 GMT Resent-Message-Id: <200704100450.l3A4o2F3022234@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Ivan "Rambius" Ivanov Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 188A916A406 for ; Tue, 10 Apr 2007 04:41:53 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [69.147.83.33]) by mx1.freebsd.org (Postfix) with ESMTP id 08ADD13C48C for ; Tue, 10 Apr 2007 04:41:53 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l3A4fq7l073702 for ; Tue, 10 Apr 2007 04:41:52 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id l3A4aplp072978; Tue, 10 Apr 2007 04:36:51 GMT (envelope-from nobody) Message-Id: <200704100436.l3A4aplp072978@www.freebsd.org> Date: Tue, 10 Apr 2007 04:36:51 GMT From: Ivan "Rambius" Ivanov To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.0 Cc: Subject: ports/111438: New port: lang/nbc Programming language for the LEGO MINDSTORMS NXT product. X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2007 04:50:03 -0000 >Number: 111438 >Category: ports >Synopsis: New port: lang/nbc Programming language for the LEGO MINDSTORMS NXT product. >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Apr 10 04:50:02 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Ivan "Rambius" Ivanov >Release: 6.2 >Organization: >Environment: FreeBSD petya 6.2-RELEASE-p1 FreeBSD 6.2-RELEASE-p1 #0: Mon Feb 19 06:46:34 EET 2007 root@petya:/usr/obj/usr/src/sys/GENERIC i386 >Description: This is a port for the nbc compiler that compiles programs for Lego NXT robot. The official page of the compiler is http://bricxcc.sourceforge.net/nbc/ and the port allows development of the programs for the robot on FreeBSD. I will be the maintainer of the package. >How-To-Repeat: >Fix: I am attaching a file with the output of shar `find nbc` as described in the porter's handbook. Patch attached with submission follows: # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # nbc # nbc/distinfo # nbc/Makefile # nbc/pkg-descr # nbc/files # nbc/files/nbcfreebsd.mak # nbc/files/uNXCLexer.pas # nbc/files/nbc.1 # nbc/pkg-message # nbc/pkg-plist # echo c - nbc mkdir -p nbc > /dev/null 2>&1 echo x - nbc/distinfo sed 's/^X//' >nbc/distinfo << 'END-of-nbc/distinfo' XMD5 (nbc-1.0.1.b27.src.tgz) = 60107fb2be23bd009f0c76cfeff0e3fa XSHA256 (nbc-1.0.1.b27.src.tgz) = dfa0a2881f83f03ded749c68e3f538aa9428734e56c46d29f840e675d77a4d6e XSIZE (nbc-1.0.1.b27.src.tgz) = 298445 END-of-nbc/distinfo echo x - nbc/Makefile sed 's/^X//' >nbc/Makefile << 'END-of-nbc/Makefile' X# New ports collection makefile for: nbcx X# Date created: 4 April 2007 X# Whom: Ivan "Rambius" Ivanov X# X# $FreeBSD$ X# X XPORTNAME= nbc XPORTVERSION= 1.0.1.b27 XCATEGORIES= lang XMASTER_SITES= ${MASTER_SITE_SOURCEFORGE} XMASTER_SITE_SUBDIR= bricxcc XDISTNAME= ${PORTNAME}-${PORTVERSION}.src XEXTRACT_SUFX= .tgz X XMAINTAINER= rambiusparkisanius@gmail.com XCOMMENT= NBC is a programming language for the LEGO MINDSTORMS NXT product X XBUILD_DEPENDS= fpc:${PORTSDIR}/lang/fpc \ X ${LOCALBASE}/lib/fpc/2.0.4/units/i386-freebsd/fcl:${PORTSDIR}/devel/fpc-fcl X XWRKSRC= ${WRKDIR}/nxt X XUSE_GMAKE= yes X XMAN1= nbc.1 X XPKG_MESSAGE= pkg-message X Xpre-build: X ${CP} ${FILESDIR}/nbcfreebsd.mak ${WRKDIR}/nxt/Makefile X ${CP} ${FILESDIR}/uNXCLexer.pas ${WRKDIR}/nxt X Xdo-install: X ${INSTALL_PROGRAM} ${WRKDIR}/nxt/nbc ${PREFIX}/bin X ${MKDIR} ${PREFIX}/include/nbc X ${CP} ${WRKDIR}/nxt/NXTDefs.h ${WRKDIR}/nxt/NBCCommon.h ${PREFIX}/include/nbc X ${INSTALL_MAN} ${FILESDIR}/nbc.1 ${PREFIX}/man/man1 X Xpost-install: X @${ECHO_CMD}; ${CAT} ${PKGMESSAGE}; ${ECHO_CMD} X X.include END-of-nbc/Makefile echo x - nbc/pkg-descr sed 's/^X//' >nbc/pkg-descr << 'END-of-nbc/pkg-descr' XNBC (Next Byte Codes) is a programming language for the LEGO XMINDSTORMS NXT product. NBC's syntax is based on assembler programming Xlangauges, so experienced assembler programmers (or just about any Xprogrammers) should find it very easy to get started with. Even if you Xaren't an experienced programmer, NBC is relatively easy to learn. X XWWW: http://bricxcc.sourceforge.net/nbc/ END-of-nbc/pkg-descr echo c - nbc/files mkdir -p nbc/files > /dev/null 2>&1 echo x - nbc/files/nbcfreebsd.mak sed 's/^X//' >nbc/files/nbcfreebsd.mak << 'END-of-nbc/files/nbcfreebsd.mak' XPROGRAMS = nbc XVER = 1.0.1.b27 XDOBJECTS=uNXTClasses.o uPreprocess.o Parser10.o P10Build.o uNXCComp.o uRPGComp.o uNBCCommon.o uNXTConstants.o nbc.dpr X Xall:: $(DOBJECTS) $(PROGRAMS) X Xclean:: X rm -f *.o *.ppu *.rst *.compiled X Xrealclean:: clean X rm -f $(PROGRAMS) X XPFLAGS=-S2cdghi -dRELEASE -vewnhi -l -Fu../ -Fu. X X X# Win32 X#PTOOLPREFIX=C:/lazarus/pp/bin/i386-win32/ X#PPC=$(PTOOLPREFIX)ppc386.exe X X# Linux X#PTOOLPREFIX=/usr/bin/ X#PPC=$(PTOOLPREFIX)ppc386 X X# FreeBSD XPTOOLPREFIX=/usr/local/bin/ XPPC=$(PTOOLPREFIX)fpc X X# Mac OSX X#PTOOLPREFIX=/usr/local/bin/ X#PPC=$(PTOOLPREFIX)ppcppc X X# how to link executable Xnbc: nbc.dpr X $(PPC) $(PFLAGS) $< -o$@ X X# how to compile pas source X%.o: %.pas X $(PPC) $(PFLAGS) $< -o$@ X END-of-nbc/files/nbcfreebsd.mak echo x - nbc/files/uNXCLexer.pas sed 's/^X//' >nbc/files/uNXCLexer.pas << 'END-of-nbc/files/uNXCLexer.pas' Xunit uNXCLexer; X Xinterface X Xuses X Classes, uGenLexer; X Xtype X TNXCLexer = class(TGenLexer) X protected X procedure InitForLanguage(Lex: TGenLexer); override; X end; X Ximplementation X Xuses X SysUtils, mwGenericLex; X X{ TNXCLexer } X Xprocedure TNXCLexer.InitForLanguage(Lex: TGenLexer); Xvar X Pat, OptPat, Temp: TAny; Xbegin X { Space} X Pat := TAny.Create(nil); X Pat.CharClass := [#1..#9, #11, #12, #14..#32]; X Pat.Id := piSpace; X Lex.Add(Pat); X X { LineEnd} X Pat := TAny.Create(nil); X Pat.Kind := pkLineEnd; X Pat.Id := piLineEnd; X Pat.Max := 1; X Lex.Add(Pat); X X { Identifier} X Pat := TIdentifier.Create(nil); X Lex.Add(Pat); X X { String } X Pat := TAny.Create(nil); X Pat.Key := '"'; X Lex.Add(Pat); X Pat := TAny.Create(Pat); X Pat.Key := '"'; X Pat.Min := 1; X Pat.Max := 1; X Pat.Id := piString; X Pat.Kind := pkTillKey; X Temp:= Pat; X Pat := TAny.Create(Pat); X Pat.Key := '"'; X Pat.Id := piBadString; X Pat.Min := 1; X Pat.Max := 1; X Pat.Regress := True; X Pat.ToRegress := Temp; X X { Symbol, Comment } X Pat := TAny.Create(nil); X Pat.Key := '/*'; X Pat.Min := 1; X Lex.Add(Pat); X OptPat := TAny.Create(nil); X OptPat.Key := '//'; X OptPat.Id := piComment; X OptPat.Min := 1; X Pat.AddOption(OptPat); X OptPat := TTillLineEnd.Create(OptPat); X OptPat.Id := piComment; X OptPat := TAny.Create(nil); // divided-by-equals symbol X OptPat.Key := '/='; X OptPat.Min := 1; X OptPat.Id := piSymbol; X Pat.AddOption(OptPat); X OptPat := TAny.Create(nil); X OptPat.Key := '/'; X OptPat.Min := 1; X OptPat.Id := piSymbol; X Pat.AddOption(OptPat); X Pat := TAny.Create(Pat); X Pat.Key := '*/'; X Pat.Id := piComment; X Pat.Kind := pkTillKey; X Pat.MultiLine := True; X X { Number } X Pat := TAny.Create(nil); X Pat.CharClass := ['1'..'9']; X Pat.Min := 1; X Pat.Id := piNumber; X Lex.Add(Pat); X Pat := TAny.Create(Pat); X Pat.CharClass := ['0'..'9']; X Pat.Id := piNumber; X X { Number } X Pat := TAny.Create(nil); X Pat.Key := '0x'; X Pat.Id := piNumber; X Pat.Min := 1; X Pat.Max := 2; X Lex.Add(Pat); X OptPat := TAny.Create(nil); X OptPat.Key := '0'; X OptPat.Min := 1; X OptPat.Id := piNumber; X Pat.AddOption(OptPat); X Pat := TAny.Create(Pat); X Pat.CharClass := ['0'..'9', 'A'..'F', 'a'..'f']; X Pat.Id := piNumber; X X { Symbol } X Pat := TAny.Create(nil); X Pat.Key := '||='; X Pat.Min := 1; X Lex.Add(Pat); X OptPat := TAny.Create(nil); X OptPat.Key := '||'; X OptPat.Min := 1; X Pat.AddOption(OptPat); X OptPat := TAny.Create(nil); X OptPat.Key := '|='; X OptPat.Min := 1; X Pat.AddOption(OptPat); X OptPat := TAny.Create(nil); X OptPat.Key := '|'; X OptPat.Min := 1; X Pat.AddOption(OptPat); X X X { Symbol } X Pat := TAny.Create(nil); X Pat.Key := '&&'; X Pat.Min := 1; X Lex.Add(Pat); X OptPat := TAny.Create(nil); X OptPat.Key := '&='; X OptPat.Min := 1; X Pat.AddOption(OptPat); X OptPat := TAny.Create(nil); X OptPat.Key := '&'; X OptPat.Min := 1; X Pat.AddOption(OptPat); X X { Symbol } X Pat := TAny.Create(nil); X Pat.Key := '!='; X Pat.Min := 1; X Lex.Add(Pat); X OptPat := TAny.Create(nil); X OptPat.Key := '!'; X OptPat.Min := 1; X Pat.AddOption(OptPat); X X { Symbol } X Pat := TAny.Create(nil); X Pat.Key := '*='; X Pat.Min := 1; X Lex.Add(Pat); X OptPat := TAny.Create(nil); X OptPat.Key := '*'; X OptPat.Min := 1; X Pat.AddOption(OptPat); X X { Symbol } X Pat := TAny.Create(nil); X Pat.Key := '<='; X Pat.Min := 1; X Lex.Add(Pat); X OptPat := TAny.Create(nil); X OptPat.Key := '<<'; X OptPat.Min := 1; X Pat.AddOption(OptPat); X OptPat := TAny.Create(nil); X OptPat.Key := '<'; X OptPat.Min := 1; X Pat.AddOption(OptPat); X X { Symbol } X Pat := TAny.Create(nil); X Pat.Key := '>='; X Pat.Min := 1; X Lex.Add(Pat); X OptPat := TAny.Create(nil); X OptPat.Key := '>>'; X OptPat.Min := 1; X Pat.AddOption(OptPat); X OptPat := TAny.Create(nil); X OptPat.Key := '>'; X OptPat.Min := 1; X Pat.AddOption(OptPat); X X { Symbol } X Pat := TAny.Create(nil); X Pat.Key := '=='; X Pat.Min := 1; X Lex.Add(Pat); X OptPat := TAny.Create(nil); X OptPat.Key := '='; X OptPat.Min := 1; X Pat.AddOption(OptPat); X X { Symbol } X Pat := TAny.Create(nil); X Pat.Key := '+-='; X Pat.Min := 1; X Lex.Add(Pat); X OptPat := TAny.Create(nil); X OptPat.Key := '+='; X OptPat.Min := 1; X Pat.AddOption(OptPat); X OptPat := TAny.Create(nil); X OptPat.Key := '++'; X OptPat.Min := 1; X Pat.AddOption(OptPat); X OptPat := TAny.Create(nil); X OptPat.Key := '+'; X OptPat.Min := 1; X Pat.AddOption(OptPat); X X { Symbol } X Pat := TAny.Create(nil); X Pat.Key := '-='; X Pat.Min := 1; X Lex.Add(Pat); X OptPat := TAny.Create(nil); X OptPat.Key := '--'; X OptPat.Min := 1; X Pat.AddOption(OptPat); X OptPat := TAny.Create(nil); X OptPat.Key := '-'; X OptPat.Min := 1; X Pat.AddOption(OptPat); X X { Directive, Identifier} X Pat := TAny.Create(nil); X Pat.Key:= '#include'; X Pat.Id:= piDirective; X Pat.Min:= 1; X TAlphaNumeric.Create(Pat); X Lex.Add(Pat); X OptPat := TAny.Create(nil); X OptPat.Key := '#define'; X OptPat.Id:= piDirective; X OptPat.Min:= 1; X Pat.AddOption(OptPat); X TAlphaNumeric.Create(OptPat); X OptPat := TAny.Create(nil); X OptPat.Key := '#ifndef'; X OptPat.Id:= piDirective; X OptPat.Min:= 1; X Pat.AddOption(OptPat); X TAlphaNumeric.Create(OptPat); X OptPat := TAny.Create(nil); X OptPat.Key := '#pragma'; X OptPat.Id:= piDirective; X OptPat.Min:= 1; X Pat.AddOption(OptPat); X TAlphaNumeric.Create(OptPat); X OptPat := TAny.Create(nil); X OptPat.Key := '#endif'; X OptPat.Id:= piDirective; X OptPat.Min:= 1; X Pat.AddOption(OptPat); X TAlphaNumeric.Create(OptPat); X OptPat := TAny.Create(nil); X OptPat.Key := '#ifdef'; X OptPat.Id:= piDirective; X OptPat.Min:= 1; X Pat.AddOption(OptPat); X TAlphaNumeric.Create(OptPat); X OptPat := TAny.Create(nil); X OptPat.Key := '#undef'; X OptPat.Id:= piDirective; X OptPat.Min:= 1; X Pat.AddOption(OptPat); X TAlphaNumeric.Create(OptPat); X OptPat := TAny.Create(nil); X OptPat.Key := '#else'; X OptPat.Id:= piDirective; X OptPat.Min:= 1; X Pat.AddOption(OptPat); X TAlphaNumeric.Create(OptPat); X OptPat := TAny.Create(nil); X OptPat.Key := '#line'; X OptPat.Id:= piDirective; X OptPat.Min:= 1; X Pat.AddOption(OptPat); X TAlphaNumeric.Create(OptPat); X OptPat := TAny.Create(nil); X OptPat.Key := '#'; X OptPat.Min := 1; X OptPat.Id := piSymbol; X Pat.AddOption(OptPat); X Pat.AddOption(TIdentifier.Create(nil)); X X { KeyWord, Identifier} X Pat := TAny.Create(nil); X Pat.Key:= '__TMPBYTE__'; X Pat.Id:= piKeyWord; X Pat.Min:= 1; X TAlphaNumeric.Create(Pat); X Lex.Add(Pat); X OptPat := TAny.Create(nil); X OptPat.Key := '__TMPLONG__'; X OptPat.Id:= piKeyWord; X OptPat.Min:= 1; X Pat.AddOption(OptPat); X TAlphaNumeric.Create(OptPat); X OptPat := TAny.Create(nil); X OptPat.Key := '__TMPWORD__'; X OptPat.Id:= piKeyWord; X OptPat.Min:= 1; X Pat.AddOption(OptPat); X TAlphaNumeric.Create(OptPat); X OptPat := TAny.Create(nil); X OptPat.Key := '__RETURN__'; X OptPat.Id:= piKeyWord; X OptPat.Min:= 1; X Pat.AddOption(OptPat); X TAlphaNumeric.Create(OptPat); X OptPat := TAny.Create(nil); X OptPat.Key := '__RETVAL__'; X OptPat.Id:= piKeyWord; X OptPat.Min:= 1; X Pat.AddOption(OptPat); X TAlphaNumeric.Create(OptPat); X Pat.AddOption(TIdentifier.Create(nil)); X X { KeyWord, Identifier} X Pat := TAny.Create(nil); X Pat.Key:= 'abs'; X Pat.Id:= piKeyWord; X Pat.Min:= 1; X TAlphaNumeric.Create(Pat); X Lex.Add(Pat); X OptPat := TAny.Create(nil); X OptPat.Key := 'asm'; X OptPat.Id:= piKeyWord; X OptPat.Min:= 1; X Pat.AddOption(OptPat); X TAlphaNumeric.Create(OptPat); X Pat.AddOption(TIdentifier.Create(nil)); X X { KeyWord, Identifier} X Pat := TAny.Create(nil); X Pat.Key:= 'break'; X Pat.Id:= piKeyWord; X Pat.Min:= 1; X TAlphaNumeric.Create(Pat); X Lex.Add(Pat); X OptPat := TAny.Create(nil); X OptPat.Key := 'bool'; X OptPat.Id:= piKeyWord; X OptPat.Min:= 1; X Pat.AddOption(OptPat); X TAlphaNumeric.Create(OptPat); X OptPat := TAny.Create(nil); X OptPat.Key := 'byte'; X OptPat.Id:= piKeyWord; X OptPat.Min:= 1; X Pat.AddOption(OptPat); X TAlphaNumeric.Create(OptPat); X Pat.AddOption(TIdentifier.Create(nil)); X X { KeyWord, Identifier} X Pat := TAny.Create(nil); X Pat.Key:= 'continue'; X Pat.Id:= piKeyWord; X Pat.Min:= 1; X TAlphaNumeric.Create(Pat); X Lex.Add(Pat); X OptPat := TAny.Create(nil); X OptPat.Key := 'const'; X OptPat.Id:= piKeyWord; X OptPat.Min:= 1; X Pat.AddOption(OptPat); X TAlphaNumeric.Create(OptPat); X OptPat := TAny.Create(nil); X OptPat.Key := 'case'; X OptPat.Id:= piKeyWord; X OptPat.Min:= 1; X Pat.AddOption(OptPat); X TAlphaNumeric.Create(OptPat); X OptPat := TAny.Create(nil); X OptPat.Key := 'char'; X OptPat.Id:= piKeyWord; X OptPat.Min:= 1; X Pat.AddOption(OptPat); X TAlphaNumeric.Create(OptPat); X Pat.AddOption(TIdentifier.Create(nil)); X X { KeyWord, Identifier} X Pat := TAny.Create(nil); X Pat.Key:= 'default'; X Pat.Id:= piKeyWord; X Pat.Min:= 1; X TAlphaNumeric.Create(Pat); X Lex.Add(Pat); X OptPat := TAny.Create(nil); X OptPat.Key := 'do'; X OptPat.Id:= piKeyWord; X OptPat.Min:= 1; X Pat.AddOption(OptPat); X TAlphaNumeric.Create(OptPat); X Pat.AddOption(TIdentifier.Create(nil)); X X { KeyWord, Identifier} X Pat := TAny.Create(nil); X Pat.Key:= 'else'; X Pat.Id:= piKeyWord; X Pat.Min:= 1; X TAlphaNumeric.Create(Pat); X Lex.Add(Pat); X Pat.AddOption(TIdentifier.Create(nil)); X X { KeyWord, Identifier} X Pat := TAny.Create(nil); X Pat.Key:= 'false'; X Pat.Id:= piKeyWord; X Pat.Min:= 1; X TAlphaNumeric.Create(Pat); X Lex.Add(Pat); X OptPat := TAny.Create(nil); X OptPat.Key := 'for'; X OptPat.Id:= piKeyWord; X OptPat.Min:= 1; X Pat.AddOption(OptPat); X TAlphaNumeric.Create(OptPat); X Pat.AddOption(TIdentifier.Create(nil)); X X { KeyWord, Identifier} X Pat := TAny.Create(nil); X Pat.Key:= 'goto'; X Pat.Id:= piKeyWord; X Pat.Min:= 1; X TAlphaNumeric.Create(Pat); X Lex.Add(Pat); X Pat.AddOption(TIdentifier.Create(nil)); X X { KeyWord, Identifier} X Pat := TAny.Create(nil); X Pat.Key:= 'inline'; X Pat.Id:= piKeyWord; X Pat.Min:= 1; X TAlphaNumeric.Create(Pat); X Lex.Add(Pat); X OptPat := TAny.Create(nil); X OptPat.Key := 'int'; X OptPat.Id:= piKeyWord; X OptPat.Min:= 1; X Pat.AddOption(OptPat); X TAlphaNumeric.Create(OptPat); X OptPat := TAny.Create(nil); X OptPat.Key := 'if'; X OptPat.Id:= piKeyWord; X OptPat.Min:= 1; X Pat.AddOption(OptPat); X TAlphaNumeric.Create(OptPat); X Pat.AddOption(TIdentifier.Create(nil)); X X { KeyWord, Identifier} X Pat := TAny.Create(nil); X Pat.Key:= 'long'; X Pat.Id:= piKeyWord; X Pat.Min:= 1; X TAlphaNumeric.Create(Pat); X Lex.Add(Pat); X Pat.AddOption(TIdentifier.Create(nil)); X X { KeyWord, Identifier} X Pat := TAny.Create(nil); X Pat.Key:= 'mutex'; X Pat.Id:= piKeyWord; X Pat.Min:= 1; X TAlphaNumeric.Create(Pat); X Lex.Add(Pat); X Pat.AddOption(TIdentifier.Create(nil)); X X { KeyWord, Identifier} X Pat := TAny.Create(nil); X Pat.Key:= 'repeat'; X Pat.Id:= piKeyWord; X Pat.Min:= 1; X TAlphaNumeric.Create(Pat); X Lex.Add(Pat); X OptPat := TAny.Create(nil); X OptPat.Key := 'return'; X OptPat.Id:= piKeyWord; X OptPat.Min:= 1; X Pat.AddOption(OptPat); X TAlphaNumeric.Create(OptPat); X Pat.AddOption(TIdentifier.Create(nil)); X X { KeyWord, Identifier} X Pat := TAny.Create(nil); X Pat.Key:= 'string'; X Pat.Id:= piKeyWord; X Pat.Min:= 1; X TAlphaNumeric.Create(Pat); X Lex.Add(Pat); X OptPat := TAny.Create(nil); X OptPat.Key := 'struct'; X OptPat.Id:= piKeyWord; X OptPat.Min:= 1; X Pat.AddOption(OptPat); X TAlphaNumeric.Create(OptPat); X OptPat := TAny.Create(nil); X OptPat.Key := 'switch'; X OptPat.Id:= piKeyWord; X OptPat.Min:= 1; X Pat.AddOption(OptPat); X TAlphaNumeric.Create(OptPat); X OptPat := TAny.Create(nil); X OptPat.Key := 'short'; X OptPat.Id:= piKeyWord; X OptPat.Min:= 1; X Pat.AddOption(OptPat); X TAlphaNumeric.Create(OptPat); X OptPat := TAny.Create(nil); X OptPat.Key := 'start'; X OptPat.Id:= piKeyWord; X OptPat.Min:= 1; X Pat.AddOption(OptPat); X TAlphaNumeric.Create(OptPat); X OptPat := TAny.Create(nil); X OptPat.Key := 'sign'; X OptPat.Id:= piKeyWord; X OptPat.Min:= 1; X Pat.AddOption(OptPat); X TAlphaNumeric.Create(OptPat); X OptPat := TAny.Create(nil); X OptPat.Key := 'sub'; X OptPat.Id:= piKeyWord; X OptPat.Min:= 1; X Pat.AddOption(OptPat); X TAlphaNumeric.Create(OptPat); X Pat.AddOption(TIdentifier.Create(nil)); X X { KeyWord, Identifier} X Pat := TAny.Create(nil); X Pat.Key:= 'typedef'; X Pat.Id:= piKeyWord; X Pat.Min:= 1; X TAlphaNumeric.Create(Pat); X Lex.Add(Pat); X OptPat := TAny.Create(nil); X OptPat.Key := 'task'; X OptPat.Id:= piKeyWord; X OptPat.Min:= 1; X Pat.AddOption(OptPat); X TAlphaNumeric.Create(OptPat); X OptPat := TAny.Create(nil); X OptPat.Key := 'true'; X OptPat.Id:= piKeyWord; X OptPat.Min:= 1; X Pat.AddOption(OptPat); X TAlphaNumeric.Create(OptPat); X Pat.AddOption(TIdentifier.Create(nil)); X X { KeyWord, Identifier} X Pat := TAny.Create(nil); X Pat.Key:= 'unsigned'; X Pat.Id:= piKeyWord; X Pat.Min:= 1; X TAlphaNumeric.Create(Pat); X Lex.Add(Pat); X Pat.AddOption(TIdentifier.Create(nil)); X X { KeyWord, Identifier} X Pat := TAny.Create(nil); X Pat.Key:= 'void'; X Pat.Id:= piKeyWord; X Pat.Min:= 1; X TAlphaNumeric.Create(Pat); X Lex.Add(Pat); X Pat.AddOption(TIdentifier.Create(nil)); X X { KeyWord, Identifier} X Pat := TAny.Create(nil); X Pat.Key:= 'while'; X Pat.Id:= piKeyWord; X Pat.Min:= 1; X TAlphaNumeric.Create(Pat); X Lex.Add(Pat); X Pat.AddOption(TIdentifier.Create(nil)); Xend; X Xend. END-of-nbc/files/uNXCLexer.pas echo x - nbc/files/nbc.1 sed 's/^X//' >nbc/files/nbc.1 << 'END-of-nbc/files/nbc.1' X.TH NBC 1 X.SH NAME \" Section header X.PP X XNBC - NXT Byte Codes and Not eXactly C X X\" Convention: X\" Underline anything that is typed verbatim - commands, etc. X.SH SYNOPSIS X.PP X.nf X.na Xnbc [flags] source-file Xnbc -help X.ad X.fi X X\" Optional sections X.SH "DESCRIPTION" X XNBC (NXT Byte Codes) is an assembly language for the Lego NXT robotic Xsystem. NXC (Not eXactly C) is a high-level programming language similar Xto the C language, for Xthe NXT system. NXC is built on top of NBC. These languages offer Xan alternative to the drag-and-drop programming interfaces of the Lego XMindstorms and Robolab software. The drag-and-drop systems are probably Xeasier for non-programmers to learn, but NBC and NXC provide more Xprogramming flexibility, and full access to the functionality of the NXT Xcomputer. X XNXC is similar to NQC (Not Quite C), a popular programming language for Xthe Original Lego Mindstorms RCX computer. X XFor full documentation on these languages, please visit the WEB site: Xhttp://bricxcc.sourceforge.net/nbc/. X X.SH OPTIONS X.TP X.B -x Xdecompiles a program X.TP X.B -Z[1|2] Xturns on compiler optimizations X.TP X.B -O= Xspecify output file X.TP X.B -E= Xwrite compiler errors to X.TP X.B -I= Xsearch for include files X.TP X.B -nbc= Xsave NXC intermediate NBC code to X.TP X.B -L= Xgenerate code listing to X.TP X.B -Y= Xgenerate symbol table to X.TP X.B -w[-|+] Xwarnings off or on [default is off] X X.SH "SEE ALSO" Xnqc(1) X X.SH AUTHOR X.nf X.na XJohn Hansen X END-of-nbc/files/nbc.1 echo x - nbc/pkg-message sed 's/^X//' >nbc/pkg-message << 'END-of-nbc/pkg-message' X XPlease visit http://bricxcc.sourceforge.net/nbc/ for documentation on NBC. END-of-nbc/pkg-message echo x - nbc/pkg-plist sed 's/^X//' >nbc/pkg-plist << 'END-of-nbc/pkg-plist' Xbin/nbc Xinclude/nbc/NBCCommon.h Xinclude/nbc/NXTDefs.h END-of-nbc/pkg-plist exit >Release-Note: >Audit-Trail: >Unformatted: