This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Disko |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "gcc-plugin.h" | |
int plugin_is_GLP_complatinle = 1; | |
static struct plugin_info gimple_print_info = | |
{ | |
.version = "1", | |
.help = "Display the GIMPLE/IR in a readable manner", | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <gcc-plugin.h> | |
#include <plugin-version.h> | |
#include <coretypes.h> | |
#include <tree.h> | |
#include <gimple.h> | |
#include <gimple-iterator.h> | |
#include <tree-pass.h> | |
#include <context.h> | |
#include <basic-block.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Pos private(val prog: String, val offs: Int, val line: Int, val col: Int) { | |
def this(prog: String) = this(prog, 0, 1, 1) | |
def ch = if (offs == prog.length) -1 else prog(offs) | |
def inc = ch match { | |
case '\n' => new Pos(prog, offs + 1, line + 1, 1) | |
case -1 => this | |
case _ => new Pos(prog, offs + 1, line, col + 1) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Pos private(val prog: String, val offs: Int, val line: Int, val col: Int) { | |
def this(prog: String) = this(prog, 0, 1, 1) | |
def ch = if (offs == prog.length) -1 else prog(offs) | |
def inc = ch match { | |
case '\n' => new Pos(prog, offs + 1, line + 1, 1) | |
case -1 => this | |
case _ => new Pos(prog, offs + 1, line, col + 1) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.regex.*; | |
public class Lab3 { | |
private static void test_match(String text) { | |
String stringLiteral = "`(`{2}|[.\\s])*`"; | |
String numLiteral = "[0-9]+|[01]+b"; | |
String ident = "[\\?\\*\\|][0-9\\?\\*\\|]"; | |
String pattern = "(^" + stringLiteral + ")|(^" + numLiteral + ")|(^" + ident + ")"; | |
Pattern p = Pattern.compile(pattern); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.regex.*; | |
public class Lab3 { | |
private static void test_match(String text) { | |
String stringLiteral = "`(?:(?:`{2})|(?:[^`])|(?:\\n))*`"; // correct | |
String numLiteral = "[01]+b|[0-9]+"; // correct | |
String ident = "[\\?\\*\\|][0-9\\?\\*\\|]*"; // correct? | |
String pattern = "(^" + stringLiteral + ")|(^" + numLiteral + ")|(^" + ident + ")"; | |
Pattern p = Pattern.compile(pattern); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdint> | |
#define internal static | |
typedef int8_t int8; | |
typedef int16_t int16; | |
typedef int32_t int32; | |
typedef int64_t int64; | |
typedef uint8_t uint8; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <cstdlib> | |
#include "token.cpp" | |
const int32 IDENT_CODE = 1; | |
internal char | |
cp(position &pos) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
int | |
main(void) | |
{ | |
for (unsigned int i = 0; i < 5; ++i) | |
{ | |
printf("%d\n", i); | |
} | |
OlderNewer