Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Apr 2007 04:36:51 GMT
From:      Ivan "Rambius" Ivanov<rambiusparkisanius@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/111438: New port: lang/nbc Programming language for the LEGO MINDSTORMS NXT product.
Message-ID:  <200704100436.l3A4aplp072978@www.freebsd.org>
Resent-Message-ID: <200704100450.l3A4o2F3022234@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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 <rambiusparkisanius@gmail.com>
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 <bsd.port.mk>
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=<outfile>
Xspecify output file
X.TP
X.B -E=<filename>
Xwrite compiler errors to <filename>
X.TP
X.B -I=<path>
Xsearch <path> for include files
X.TP
X.B -nbc=<filename>
Xsave NXC intermediate NBC code to <filename>
X.TP
X.B -L=<filename>
Xgenerate code listing to <filename>
X.TP
X.B -Y=<filename>
Xgenerate symbol table to <filename>
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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200704100436.l3A4aplp072978>