code
stringlengths
1
2.01M
repo_name
stringlengths
3
62
path
stringlengths
1
267
language
stringclasses
231 values
license
stringclasses
13 values
size
int64
1
2.01M
package com.trilead.ssh2.crypto.cipher; /** * BlockCipher. * * @author Christian Plattner, plattner@trilead.com * @version $Id: BlockCipher.java,v 1.1 2007/10/15 12:49:55 cplattne Exp $ */ public interface BlockCipher { public void init(boolean forEncryption, byte[] key); public int getBlockSize()...
0359xiaodong-sydy
src/com/trilead/ssh2/crypto/cipher/BlockCipher.java
Java
asf20
406
package com.trilead.ssh2.crypto.cipher; /* This file was shamelessly taken (and modified) from the Bouncy Castle Crypto package. Their licence file states the following: Copyright (c) 2000 - 2004 The Legion Of The Bouncy Castle (http://www.bouncycastle.org) Permission is hereby granted, free of charg...
0359xiaodong-sydy
src/com/trilead/ssh2/crypto/cipher/DESede.java
Java
asf20
2,900
package com.trilead.ssh2.crypto.cipher; /* This file was shamelessly taken from the Bouncy Castle Crypto package. Their licence file states the following: Copyright (c) 2000 - 2004 The Legion Of The Bouncy Castle (http://www.bouncycastle.org) Permission is hereby granted, free of charge, to any perso...
0359xiaodong-sydy
src/com/trilead/ssh2/crypto/cipher/BlowFish.java
Java
asf20
20,816
package com.trilead.ssh2.crypto.cipher; /** * NullCipher. * * @author Christian Plattner, plattner@trilead.com * @version $Id: NullCipher.java,v 1.1 2007/10/15 12:49:55 cplattne Exp $ */ public class NullCipher implements BlockCipher { private int blockSize = 8; public NullCipher() { } pu...
0359xiaodong-sydy
src/com/trilead/ssh2/crypto/cipher/NullCipher.java
Java
asf20
663
package com.trilead.ssh2.crypto.digest; import java.math.BigInteger; /** * HashForSSH2Types. * * @author Christian Plattner, plattner@trilead.com * @version $Id: HashForSSH2Types.java,v 1.1 2007/10/15 12:49:57 cplattne Exp $ */ public class HashForSSH2Types { Digest md; public HashForSSH2Type...
0359xiaodong-sydy
src/com/trilead/ssh2/crypto/digest/HashForSSH2Types.java
Java
asf20
1,553
package com.trilead.ssh2.crypto.digest; /** * MAC. * * @author Christian Plattner, plattner@trilead.com * @version $Id: MAC.java,v 1.1 2007/10/15 12:49:57 cplattne Exp $ */ public final class MAC { Digest mac; int size; public final static String[] getMacList() { /* Higher Priority First ...
0359xiaodong-sydy
src/com/trilead/ssh2/crypto/digest/MAC.java
Java
asf20
1,822
package com.trilead.ssh2.crypto.digest; /** * HMAC. * * @author Christian Plattner, plattner@trilead.com * @version $Id: HMAC.java,v 1.1 2007/10/15 12:49:57 cplattne Exp $ */ public final class HMAC implements Digest { Digest md; byte[] k_xor_ipad; byte[] k_xor_opad; byte[] tmp; int size...
0359xiaodong-sydy
src/com/trilead/ssh2/crypto/digest/HMAC.java
Java
asf20
1,578
package com.trilead.ssh2.crypto.digest; /** * MD5. Based on the example code in RFC 1321. Optimized (...a little). * * @author Christian Plattner, plattner@trilead.com * @version $Id: MD5.java,v 1.1 2007/10/15 12:49:57 cplattne Exp $ */ /* * The following disclaimer has been copied from RFC 1321: ...
0359xiaodong-sydy
src/com/trilead/ssh2/crypto/digest/MD5.java
Java
asf20
8,195
package com.trilead.ssh2.crypto.digest; /** * SHA-1 implementation based on FIPS PUB 180-1. * Highly optimized. * <p> * (http://www.itl.nist.gov/fipspubs/fip180-1.htm) * * @author Christian Plattner, plattner@trilead.com * @version $Id: SHA1.java,v 1.1 2007/10/15 12:49:57 cplattne Exp $ */ public...
0359xiaodong-sydy
src/com/trilead/ssh2/crypto/digest/SHA1.java
Java
asf20
18,717
package com.trilead.ssh2.crypto.digest; /** * Digest. * * @author Christian Plattner, plattner@trilead.com * @version $Id: Digest.java,v 1.1 2007/10/15 12:49:57 cplattne Exp $ */ public interface Digest { public int getDigestLength(); public void update(byte b); public void update(byte[] b);...
0359xiaodong-sydy
src/com/trilead/ssh2/crypto/digest/Digest.java
Java
asf20
483
package com.trilead.ssh2.crypto; import java.io.CharArrayWriter; import java.io.IOException; /** * Basic Base64 Support. * * @author Christian Plattner, plattner@trilead.com * @version $Id: Base64.java,v 1.1 2007/10/15 12:49:56 cplattne Exp $ */ public class Base64 { static final char[] alphabet...
0359xiaodong-sydy
src/com/trilead/ssh2/crypto/Base64.java
Java
asf20
3,149
package com.trilead.ssh2.crypto; import java.io.IOException; import java.math.BigInteger; /** * SimpleDERReader. * * @author Christian Plattner, plattner@trilead.com * @version $Id: SimpleDERReader.java,v 1.1 2007/10/15 12:49:56 cplattne Exp $ */ public class SimpleDERReader { byte[] buffer; i...
0359xiaodong-sydy
src/com/trilead/ssh2/crypto/SimpleDERReader.java
Java
asf20
3,005
package com.trilead.ssh2.crypto; import java.io.BufferedReader; import java.io.CharArrayReader; import java.io.IOException; import java.math.BigInteger; import com.trilead.ssh2.crypto.cipher.AES; import com.trilead.ssh2.crypto.cipher.BlockCipher; import com.trilead.ssh2.crypto.cipher.CBCMode; import com.t...
0359xiaodong-sydy
src/com/trilead/ssh2/crypto/PEMDecoder.java
Java
asf20
9,657
package com.trilead.ssh2.crypto; import com.trilead.ssh2.compression.CompressionFactory; import com.trilead.ssh2.crypto.cipher.BlockCipherFactory; import com.trilead.ssh2.crypto.digest.MAC; import com.trilead.ssh2.transport.KexManager; /** * CryptoWishList. * * @author Christian Plattner, plattner@t...
0359xiaodong-sydy
src/com/trilead/ssh2/crypto/CryptoWishList.java
Java
asf20
1,043
package com.trilead.ssh2.crypto.dh; import java.math.BigInteger; import java.security.SecureRandom; import com.trilead.ssh2.DHGexParameters; import com.trilead.ssh2.crypto.digest.HashForSSH2Types; /** * DhGroupExchange. * * @author Christian Plattner, plattner@trilead.com * @version $Id: DhGroup...
0359xiaodong-sydy
src/com/trilead/ssh2/crypto/dh/DhGroupExchange.java
Java
asf20
2,477
package com.trilead.ssh2.crypto.dh; import java.io.UnsupportedEncodingException; import java.math.BigInteger; import java.security.SecureRandom; import com.trilead.ssh2.crypto.digest.HashForSSH2Types; import com.trilead.ssh2.log.Logger; /** * DhExchange. * * @author Christian Plattner, plattner@t...
0359xiaodong-sydy
src/com/trilead/ssh2/crypto/dh/DhExchange.java
Java
asf20
3,808
package com.trilead.ssh2.crypto; /** * Parsed PEM structure. * * @author Christian Plattner, plattner@trilead.com * @version $Id: PEMStructure.java,v 1.1 2007/10/15 12:49:56 cplattne Exp $ */ public class PEMStructure { public int pemType; String dekInfo[]; String procType[]; public byte[] d...
0359xiaodong-sydy
src/com/trilead/ssh2/crypto/PEMStructure.java
Java
asf20
327
package com.trilead.ssh2.crypto; import java.math.BigInteger; import com.trilead.ssh2.crypto.digest.HashForSSH2Types; /** * Establishes key material for iv/key/mac (both directions). * * @author Christian Plattner, plattner@trilead.com * @version $Id: KeyMaterial.java,v 1.1 2007/10/15 12:49:56 cpl...
0359xiaodong-sydy
src/com/trilead/ssh2/crypto/KeyMaterial.java
Java
asf20
2,566
package com.trilead.ssh2; /** * A <code>SFTPv3DirectoryEntry</code> as returned by {@link SFTPv3Client#ls(String)}. * * @author Christian Plattner, plattner@trilead.com * @version $Id: SFTPv3DirectoryEntry.java,v 1.1 2007/10/15 12:49:56 cplattne Exp $ */ public class SFTPv3DirectoryEntry { /** ...
0359xiaodong-sydy
src/com/trilead/ssh2/SFTPv3DirectoryEntry.java
Java
asf20
1,230
package com.trilead.ssh2.util; import java.io.PrintWriter; import java.io.StringWriter; import java.util.Collections; import java.util.LinkedList; import com.trilead.ssh2.log.Logger; /** * TimeoutService (beta). Here you can register a timeout. * <p> * Implemented having large scale programs in mi...
0359xiaodong-sydy
src/com/trilead/ssh2/util/TimeoutService.java
Java
asf20
3,443
package com.trilead.ssh2.util; /** * Tokenizer. Why? Because StringTokenizer is not available in J2ME. * * @author Christian Plattner, plattner@trilead.com * @version $Id: Tokenizer.java,v 1.1 2007/10/15 12:49:57 cplattne Exp $ */ public class Tokenizer { /** * Exists because StringTokenizer is n...
0359xiaodong-sydy
src/com/trilead/ssh2/util/Tokenizer.java
Java
asf20
1,104
/* -*-mode:java; c-basic-offset:2; -*- */ /* Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above...
0359xiaodong-sydy
src/com/jcraft/jzlib/InfBlocks.java
Java
asf20
15,158
/* -*-mode:java; c-basic-offset:2; -*- */ /* Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above...
0359xiaodong-sydy
src/com/jcraft/jzlib/StaticTree.java
Java
asf20
6,164
/* -*-mode:java; c-basic-offset:2; -*- */ /* Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above...
0359xiaodong-sydy
src/com/jcraft/jzlib/JZlib.java
Java
asf20
2,803
/* -*-mode:java; c-basic-offset:2; -*- */ /* Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above...
0359xiaodong-sydy
src/com/jcraft/jzlib/Tree.java
Java
asf20
14,868
/* -*-mode:java; c-basic-offset:2; -*- */ /* Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain th...
0359xiaodong-sydy
src/com/jcraft/jzlib/ZStreamException.java
Java
asf20
1,931
/* -*-mode:java; c-basic-offset:2; -*- */ /* Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above...
0359xiaodong-sydy
src/com/jcraft/jzlib/Deflate.java
Java
asf20
54,205
/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ /* Copyright (c) 2001 Lapo Luchini. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, ...
0359xiaodong-sydy
src/com/jcraft/jzlib/ZInputStream.java
Java
asf20
4,279
/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ /* Copyright (c) 2001 Lapo Luchini. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, ...
0359xiaodong-sydy
src/com/jcraft/jzlib/ZOutputStream.java
Java
asf20
4,315
/* -*-mode:java; c-basic-offset:2; -*- */ /* Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above...
0359xiaodong-sydy
src/com/jcraft/jzlib/Inflate.java
Java
asf20
11,302
/* -*-mode:java; c-basic-offset:2; -*- */ /* Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above...
0359xiaodong-sydy
src/com/jcraft/jzlib/InfCodes.java
Java
asf20
16,042
/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ /* Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code ...
0359xiaodong-sydy
src/com/jcraft/jzlib/ZStream.java
Java
asf20
6,990
/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ /* Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code ...
0359xiaodong-sydy
src/com/jcraft/jzlib/InfTree.java
Java
asf20
19,238
/* -*-mode:java; c-basic-offset:2; -*- */ /* Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above...
0359xiaodong-sydy
src/com/jcraft/jzlib/Adler32.java
Java
asf20
3,289
#!/usr/bin/perl # # ConnectBot: simple, powerful, open-source SSH client for Android # Copyright 2011 Kenny Root, Jeffrey Sharkey # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http:...
0359xiaodong-sydy
tools/google-code-upload.pl
Perl
asf20
7,224
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := com_google_ase_Exec LOCAL_CFLAGS := -Werror LOCAL_SRC_FILES := com_google_ase_Exec.cpp LOCAL_LDLIBS := -llog include $(BUILD_SHARED_LIBRARY)
0359xiaodong-sydy
jni/Exec/Android.mk
Makefile
asf20
220
/* * Copyright (C) 2007 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by appli...
0359xiaodong-sydy
jni/Exec/com_google_ase_Exec.cpp
C++
asf20
5,383
# Build both ARMv5TE and x86-32 machine code. APP_ABI := armeabi x86
0359xiaodong-sydy
jni/Application.mk
Makefile
asf20
69
include $(call all-subdir-makefiles)
0359xiaodong-sydy
jni/Android.mk
Makefile
asf20
37
<html> <body style="background-color: #000; color: #fff"> <p>Gestures in ConnectBot allow a user to do several things for which there&#x27;s no keyboard equivalent. If the gestures seem backward, then imagine that you&#x27;re grabbing the text and moving it with your finger.</p> <h1><a name="Page_Up_/_Page_Down" />Pag...
0359xiaodong-sydy
assets/help/ScreenGestures.html
HTML
asf20
1,613
<html> <body style="background-color: #000; color: #fff"> <p><img src="http://connectbot.googlecode.com/svn/trunk/www/keyboard.jpg" /></p> <p>Here are some keyboard shortcuts available when a <strong>hardware keyboard</strong> is present. If you&#x27;re using a phone where the main input type is a <strong>virtual key...
0359xiaodong-sydy
assets/help/PhysicalKeyboard.html
HTML
asf20
2,582
<html> <body style="background-color: #000; color: #fff"> <p><img src="http://connectbot.googlecode.com/svn/trunk/www/magic-cb-screen.png" width="100%" /></p> <h2>Caveats</h2> <p>Since ConnectBot doesn&#x27;t use any of the normal TextView widgets, Android&#x27;s IME structure isn&#x27;t designed to directly support ...
0359xiaodong-sydy
assets/help/VirtualKeyboard.html
HTML
asf20
2,345
<html> <body style="background-color: #000; color: #fff"> <h2>Helpful hints</h2> <p>When you have multiple sessions open, you can 'pan' between them by swiping your finger left-to-right or right-to-left over the screen.</p> <p>Long-press on your Android desktop to create direct shortcuts to frequently-used SSH host...
0359xiaodong-sydy
assets/help/Hints.html
HTML
asf20
515
/* atom.c - implement string atoms. */ #include "atom.h" typedef struct TAtom { const char* String; int RefCount; unsigned Hash; struct TAtom* Next; } TAtom; static TAtom* FreeList; /* list of free TAtoms */ static TAtom** HashTable; /* ...
100siddhartha-blacc
atom.c
C
mit
2,711
/* Burk Labs Anachronistic Compiler Compiler (BLACC) v0.0 * Generated from: 'test.blc' * on: Wed Feb 06 20:47:47 2013 */ #include <assert.h> #include <stdio.h> #include <stdlib.h> #include <limits.h> extern unsigned GetNextToken(void); #define BLC_GETINT(Ptr) ((Ptr)[0] | ((Ptr)[1]<<8)) ...
100siddhartha-blacc
blcparse.c
C
mit
14,599
#ifndef SYMTAB_H_ #define SYMTAB_H_ /* Our symbol table needs are modest. A symbol is either a terminal or a non-terminal. We only add items to the symbol table, never remove them. */ #ifndef COMMON_H_ # include "common.h" #endif #ifn...
100siddhartha-blacc
symtab.h
C
mit
8,908
#include "symlist.h" typedef struct TSymList { TSymbol** Symbols; int NSymbols; } TSymList;
100siddhartha-blacc
symlist.c
C
mit
139
/* ** MEMWATCH.H ** Nonintrusive ANSI C memory leak / overwrite detection ** Copyright (C) 1992-2002 Johan Lindh ** All rights reserved. ** Version 2.71 ** ************************************************************************ ** ** PURPOSE: ** ** MEMWATCH has been written to allow guys and gals that like to ** pro...
100siddhartha-blacc
memwatch.h
C++
mit
31,809
/* lex.cpp - implement lexing. * * Lex acts like a global singleton that retains in-memory copies * of ****/ #include "lex.h" #include <fstream> // keep constants in private namespace namespace { const size_t IO_SIZE = (1024*16); // grow by this much, as needed const siz...
100siddhartha-blacc
lex.cpp
C++
mit
11,848
/* map.h - simple associative container API */ #ifndef MAP_H_ #define MAP_H_ #include <stdlib.h> typedef int (*TMapCompare)(void* A, size_t ALen, void* B, size_t BLen); typedef struct MAP_ { int Dummy_; } MAP_, *MAP; MAP MapCreate(TMapCompare Compare); void* MapFind(MAP Ma...
100siddhartha-blacc
map.h
C
mit
441
# # Microsoft nmake Makefile for BLACC # # DEBUGALL=/RTC1 /MDd /DMEMDEBUG #CPPFLAGS=/Zi /W4 /D_HAS_EXCEPTIONS=0 /D_CRT_SECURE_NO_DEPRECATE /nologo /GF /TP /GS- /EHs-c- /RTCu CPPFLAGS=/Zi /W4 /D_CRT_SECURE_NO_DEPRECATE /nologo /GF /TP /GS- $(DEBUGALL) /EHsc /analyze #OBJDIR =obj EXENAME =blacc OBJS ...
100siddhartha-blacc
makefile
Makefile
mit
1,924
#ifndef BITSET_H_ #define BITSET_H_ #include <stddef.h> typedef struct _BITSET { void* _Dummy; } _BITSET, *BITSET; typedef struct BITITER { BITSET BitSet; int Index; } BITITER; BITSET BitSetNew(size_t Size); void BitSetDelete(...
100siddhartha-blacc
bitset.h
C
mit
620
#ifndef MICROSOFT_H_ #define MICROSOFT_H_ // Possibly enable memory leak detection under Microsoft Visual C++ #define MicrosoftDebug() //#ifdef _MSC_VER #if 0 # ifdef _DEBUG # define _CRTDBG_MAP_ALLOC # include <stdlib.h> # include <crtdbg.h> # undef MicrosoftDebug // chang...
100siddhartha-blacc
microsoft.h
C
mit
552
#include "javascrp.h" #define TOKEN_GROW (16) typedef struct TMarkup { int Classes; int Id; TToken Token; } TMarkup; static TMarkup* Tokens; static int TokenCount; static int TokenSize; static void GrowTokens(void) { int ...
100siddhartha-blacc
javascrp.c
C
mit
1,860
#ifndef ATOM_H_ #define ATOM_H_ /* atom.h - interface to string atoms. * */ /* ATOM - opaque handle to a string atom. */ typedef struct ATOM_ { void* Dummy; } ATOM_, *ATOM; ATOM AtomCreate(const char* String, int AutoFree); void AtomDeref(ATOM Atom); ATOM Atom...
100siddhartha-blacc
atom.h
C
mit
440
#include "common.h" #include <string> #include <map> #include <memory> struct TToken; class LexedFile { char* Load(const char* Filename); friend class Lex; LexedFile(const char* Filename); private: ~LexedFile(); LexedFile(const LexedFile& Other); // disall...
100siddhartha-blacc
foo.cpp
C++
mit
1,311
#include "symtab.h" #include "operator.h" #include "parse.h" #include "map.h" #include "globals.h" /* We use a dumb, simple hash table to look up symbols. * The table size is a prime number, since modulo a prime * is itself a nice distributor of values. 97 should be * fine for up to several hundred sym...
100siddhartha-blacc
symtab.c
C
mit
42,280
#ifndef COMMON_H_ #define COMMON_H_ /* common.h - header file with information most files need. * * This should be included first by every .h and .c file. That ensures * an opportunity to make early tweaks, such as is needed by Microsoft C++ * for memory debugging. */ //#include "microsoft.h" // should b...
100siddhartha-blacc
common.h
C++
mit
5,830
/* cstr.c - Utility to transform text file into compilable C array of char. */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #define TRUE (1) #define FALSE (0) void Usage() { fprintf(stderr, "Usage: cstr filename.str\n"); exit(EXIT_FAILURE); ...
100siddhartha-blacc
cstr.c
C
mit
4,749
#ifndef CHECK_H_ #define CHECK_H_ #ifndef SYMTAB_H_ #include "symtab.h" #endif int CheckCompleteness(void); int CheckCircularity(void); void CheckReachability(void); int CheckTermination(void); void CheckOpsUsed(void); void CheckLeftRecursion(void); void CheckFirstFollowClash(void...
100siddhartha-blacc
check.h
C
mit
487
#ifndef GEN_C_H_ #define GEN_C_H_ #include "generate.h" int GenerateC(FILE* Output, TParseTables* Tables); #endif /* GEN_C_H_ */
100siddhartha-blacc
gen_c.h
C
mit
144
#ifdef _MSC_VER #include "common.h" void MicrosoftDebug() { _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF /*| _CRTDBG_CHECK_CRT_DF */); _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE); _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE); _CrtSetReportMode(_CRT_WARN, _CRTDBG...
100siddhartha-blacc
microsoft.cpp
C++
mit
528
#ifndef LOADFILE_H_ #define LOADFILE_H_ char* LoadFile(const char* Filename); #endif /* LOADFILE_H_ */
100siddhartha-blacc
loadfile.h
C
mit
113
#ifndef SYMLIST_H_ #define SYMLIST_H_ #ifndef SYMBOL_H_ # include "symbol.h" #endif typedef struct SYMLIST_ { void* Dummy_; } SYMLIST_, *SYMLIST; SYMLIST SymListCreate(void); //#ifdef MEMWATCH //# define SymListCreate() (SYMLIST)mwMark((void*)SymListC...
100siddhartha-blacc
symlist.h
C
mit
1,972
#ifndef LR0_H_ #define LR0_H_ /* lr0.h - interface to LR(0) code. */ #include <limits.h> #if UINT_MAX < (0xFFFFFFFF) typedef int TITEM; #else typedef long TITEM; #endif #include "symtab.h" typedef struct TItemSet { int Count; TITEM* Items; } TIt...
100siddhartha-blacc
lr0.h
C
mit
1,363
#ifndef GLOBALS_H_ #define GLOBALS_H_ /* globals.h - define our global variables. */ #ifndef SYMTAB_H_ #include "symlist.h" #endif typedef struct GLOBALS { int Verbose; /* user wants verbose output? */ int Dump; /* wants debugging output? */ ...
100siddhartha-blacc
globals.h
C
mit
808
/* ** MEMWATCH.C ** Nonintrusive ANSI C memory leak / overwrite detection ** Copyright (C) 1992-2003 Johan Lindh ** All rights reserved. ** Version 2.71 This file is part of MEMWATCH. MEMWATCH is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as publ...
100siddhartha-blacc
memwatch.c
C
mit
75,970
#include "parse.h" #include "check.h" #include "operator.h" #include "globals.h" static void DumpRule(FILE* Handle, TRule* Rule) { fprintf(Handle, " -> "); SymbolListDump(Handle, Rule->Symbols, " "); fprintf(Handle, "\n"); } /* CheckLR0RuleDup() - check for duplicate rules. * ...
100siddhartha-blacc
check.c
C
mit
75,088
#include "operator.h" #include "globals.h" #include "bitset.h" /* operator.c - operator precedence code. * * Apart from parsing input, most of the work related to creating the necessary * tables for operator precedence parsing is here. */ #define LEFT_HANDLE (-1) #define RIGHT_HANDLE (1) #define ...
100siddhartha-blacc
operator.c
C
mit
43,730
/* lr0.c - Code to implement LR(0) parser construction. */ #include "globals.h" #include "lr0.h" #include "symtab.h" static void ComputeLR0(TSymbol* NonTerm); static TItemSet* CreateInitialItems(TSymbol* RootSymbol); static int StateFromItemSet(TStates* States, TItemSet* Items); static ...
100siddhartha-blacc
lr0.c
C
mit
26,126
/* map.c - simple, highly-limited container class. * * We assume nothing is ever deleted, and caller supplies (and retains) * storage for all keys and objects to be placed in a map. */ #include "map.h" #include <string.h> #include <stdio.h> #include <assert.h> #define LOADFACTOR (8) #define CHUNKSIZE ...
100siddhartha-blacc
map.c
C
mit
4,357
#ifndef SYMBOL_H_ # include "symbol.h" #endif #ifndef SYMLIST_H_ # include "symlist.h" #endif #define SYMTAB_H_ // ???TODO: temporary hack until symbols.h integrated! #ifndef GLOBALS_H_ # include "globals.h" #endif /* constants *******************************************************************...
100siddhartha-blacc
symbol.c
C
mit
6,005
#ifndef HTML_H_ #define HTML_H_ void Html(FILE* Output); #endif
100siddhartha-blacc
html.h
C
mit
75
#define _CRT_SECURE_NO_DEPRECATE #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> typedef enum { false , true } bool; /* actions */ typedef enum { S, /* shift */ R, /* reduce */ A, /* accept */ E1, ...
100siddhartha-blacc
niemann.c
C
mit
7,884
#define A a, b int A; void f() { switch(A) { default: ; } }
100siddhartha-blacc
foo.c
C
mit
109
/* generate.c - code generation functions. * */ #include "generate.h" #include "symtab.h" #include "globals.h" /* MINRANGE - minimum sequential run of tokens we will use as a range. */ #define MINRANGE (4) static void IntAdd(INTVECTOR* This, int Add) { int NewSize; NewSize ...
100siddhartha-blacc
generate.c
C
mit
28,388
#ifndef OPERATOR_H_ #define OPERATOR_H_ #ifndef SYMTAB_H_ # include "symtab.h" #endif #ifndef PARSE_H_ # include "parse.h" #endif void OperatorAdd(TToken Token, int Precedence, int Associativity, SYMBOLS List, const char* Pattern); TOperator* OperatorGet(int Which); TOperator* OperatorFindO...
100siddhartha-blacc
operator.h
C
mit
497
/* globals.cpp - source for Global. */ #include "common.h" Global::OptionBag Global::Options = { -1, // ExpectCode -1, // ExpectLine 0, // TabStop 0, // VerboseFlag false, // TokenizeFlag NULL, ...
100siddhartha-blacc
globals.cpp
C++
mit
4,284
#include <assert.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAXLINE (1024 * 2) static void Usage(void) { fprintf(stderr, "Usage:\n"); fprintf(stderr, " regress <testfile>\n"); fprintf(stderr, "Where:\n"); fprintf(stderr, " <testfile> contains d...
100siddhartha-blacc
regress.c
C
mit
3,030
#include "common.h" void Dump(const char* Format, ...) { va_list ArgPtr; if(Global::Dump()) { assert(Format != NULL); va_start(ArgPtr, Format); vfprintf(stdout, Format, ArgPtr); va_end(ArgPtr); fflush(stdout); } } void Dump...
100siddhartha-blacc
common.cpp
C++
mit
3,785
#ifndef GLOBAL_H_ #define GLOBAL_H_ #endif /* GLOBAL_H_ */
100siddhartha-blacc
global.h
C
mit
65
#include "common.h" #include "file.h" File::File() : Buffer(nullptr), Filename(nullptr) { printf("Construct file!\n"); } File::~File() { printf("Destruct file!\n"); if(Buffer) free(Buffer); }
100siddhartha-blacc
file.cpp
C++
mit
248
#nclude "walk.h" /* for IsNullable(), we want: * do not recurse on already visited symbol * ignore actions * only call me postvisit */ /* if we got to end of rule, rule is nullable, so This is nullable */ int IsNullableWalkEndRule(TWalk* Walk, TSymbol* This) { WalkResult(Walk, TRUE); ...
100siddhartha-blacc
walk.c
C
mit
722
#include "bitset.h" #include <limits.h> #include <stdlib.h> #include <assert.h> typedef unsigned BITTYPE; /* one could tinker with different sizes... */ typedef struct TBitSet { int NChunks; int NBits; BITTYPE Bits[1]; } TBitSet; static int ...
100siddhartha-blacc
bitset.c
C
mit
3,337
#ifndef WALK_H_ #define WALK_H_ typedef struct TWalkState { int iRule; int iRhs; TSymbol* Symbol; int Result; } TWalkState; typedef struct TWalk { TWalkState* Stack; int iStack; void* UserData; int ...
100siddhartha-blacc
walk.h
C
mit
500
#include "parse.h" #include "compute.h" #include "globals.h" #include "check.h" SYMBOLS LeftRecurSyms(TSymbol* Root, SYMBOLS Stack, SYMBOLS Checked); /* MarkLeftRecursive() - identify left-recursive nonterminals * * NB: we are only marking nonterminals with simple/direct * left recursion that we expect...
100siddhartha-blacc
compute.c
C
mit
51,284
#include "globals.h" #include "parse.h" #include "symtab.h" #include "operator.h" /* SyntaxPuts() - helper function for SyntaxError() * * Our lovely text error messages may come out all misaligned * if the user has used tabs in a line that we're reporting in * an error message. The best we can do is ask t...
100siddhartha-blacc
parse.c
C
mit
27,066
/* main.cpp - entry point for BLACC (Burk Labs' Anachronistic Compiler Compiler) * * BLACC is designed to be a parser generator that I can easily bend * to whatever inconvenient need I have. */ #include "common.h" #include "lex.h" #include <stdio.h> #include <thread> #include <stack> static TTokenized...
100siddhartha-blacc
main.cpp
C++
mit
3,728
/* input.c - various functions related to BLACC's input. */ #include "input.h" #include <ctype.h> #include "loadfile.h" #include "javascrp.h" typedef struct TInput { const char* Filename; char* FileText; char* FileEnd; int LineNumber; const char* Rover; ...
100siddhartha-blacc
input.c
C
mit
23,403
#ifndef INPUT_H_ #define INPUT_H_ #ifndef COMMON_H_ # include "common.h" #endif #define TK_EOF 0 #define TK_IDENT -1 #define TK_ACTION -2 #define TK_SECTION -3 #define TK_NOTUSED -4 #define TK_ILLEGAL -5 #define TK_QUOTED -6 #define TK_LEFT -7 #define TK_RI...
100siddhartha-blacc
input.h
C
mit
2,379
#ifndef JAVASCRP_H_ #define JAVASCRP_H_ /* javascrp.h - interface to storing information for later JavaScript emission. * */ #ifndef INPUT_H_ #include "input.h" #endif enum JsClass { CLASS_SYMBOL = 0x0001, CLASS_NONTERM = 0x0002, CLASS_TERMINAL = 0x0004, CLASS_...
100siddhartha-blacc
javascrp.h
C
mit
576
#ifndef SYMBOL_H_ #define SYMBOL_H_ /* symbol.h - define core data type. * * SYMBOL is an opaque pointer representing an instance of a symbol * (terminal, non-terminal, or action). There may be one or more * instances for a given symbol; an instance basically refers to a * specific textual occurrence in the...
100siddhartha-blacc
symbol.h
C++
mit
715
# GNUmakefile - Linux makefile for blacc # # last tested with G++ 4.6.3 CC = g++ CPPFLAGS = -std=c++0x -lintl OBJS = main.o common.o microsoft.o globals.o file.o lex.o EXENAME = blacc all : $(EXENAME) blacc : $(OBJS) $(CC) -o $@ $^ $(LDFLAGS) memcheck : valgrind --leak-check=full ./blacc test.blc $(OBJS) ...
100siddhartha-blacc
GNUmakefile
Makefile
mit
331
#ifndef PARSE_H_ #define PARSE_H_ #ifndef INPUT_H_ # include "input.h" #endif #ifndef SYMBOL_H_ # include "symtab.h" #endif /*extern TSymbol* StartSymbol; */ /* TSymbol* NonTermAdd(TToken Token); */ void ParseInput(); void SyntaxError(int ErrorCode, TToken Token, const char* Format,...
100siddhartha-blacc
parse.h
C
mit
354
#include "common.h" #include "globals.h" #include "loadfile.h" #include "html.h" #include "htmlform.c" /* TMacro - information about a macro invocation. * * We allow simple macro invocations of the form "@NAME@", * where "NAME" is the name of a function (TFunc) in a table * defined below. Macro invoc...
100siddhartha-blacc
html.c
C
mit
15,466
#ifndef FILE_H_ #define FILE_H_ #include <memory> #include <string> using namespace std; class File { public: File(); ~File(); char* Load(const char* Filename); private: File(const File& Other); // disallow: private and no definition File& operator=(const File& O...
100siddhartha-blacc
file.h
C++
mit
457
#ifndef GENERATE_H_ #define GENERATE_H_ #ifndef SYMTAB_H_ #include "symtab.h" #endif #define BLC_HDR_TERMSYMTAB_SIZE (0) #define BLC_HDR_NONTERMSYMTAB_SIZE (2) #define BLC_HDR_ENTRYTABLE_SIZE (4) #define BLC_HDR_SELECTTABLE_SIZE (6) #define BLC_HDR_RULEOPCODE_SIZE (8) #define BLC_HDR_SIZ...
100siddhartha-blacc
generate.h
C
mit
2,218
#ifndef LEX_H_ #define LEX_H_ #include "common.h" #include <limits.h> // a pox on C++'s limits framework! //#include <functional> #include <map> #include <memory> #include <new> #include <vector> /* TToken - a token type. * * Tokens need to be relatively small and cheap since we will be storing ...
100siddhartha-blacc
lex.h
C++
mit
4,129
#include "common.h" #include "symtab.h" #include "generate.h" #include "gen_c.h" #include "map.h" #include "globals.h" #include <time.h> /* include big char array named 'Template' */ #include "gen_ctmp.c" #define HEXFLAG (0x01) #define DECFLAG (0x00) #define TWOFLAG (0x10) #define ONEFLAG (0x00) #def...
100siddhartha-blacc
gen_c.c
C
mit
33,450
#ifndef COMPUTE_H_ #define COMPUTE_H_ void MarkNullable(void); void MarkEmpty(void); void MarkLeftRecursive(void); void RewriteGrammar(void); void ClearFirstFollow(void); void ComputeFirst(void); void ComputeFollow(void); void ComputeEndsWith(void); void ComputeLLTable(void); voi...
100siddhartha-blacc
compute.h
C
mit
379