This file contains hidden or 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 <stdio.h> | |
#include <vector> | |
using namespace std; | |
int num_vertices; | |
// this vector is for the adjacency matrix | |
vector <vector <int> > adj_matrix; |
This file contains hidden or 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 xml.parsers.expat, sys, codecs | |
skip_tags = ['cat-item', 'def-cat', 'section-def-cats', 'attr-item', 'def-attr', 'section-def-attrs', 'def-var', 'list-item', 'def-list', 'section-def-vars', 'section-def-lists'] | |
leaf_tags = ['clip', 'lit', 'lit-tag', 'with-param', 'var', 'b', 'list', 'pattern-item'] | |
class ExpatParser(object): | |
def __init__(self, fileName, compiler): | |
self.fileName = fileName |
This file contains hidden or 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 xml.parsers.expat, sys, codecs | |
skip_tags = ['cat-item', 'def-cat', 'section-def-cats', 'attr-item', 'def-attr', 'section-def-attrs', 'def-var', 'list-item', 'def-list', 'section-def-vars', 'section-def-lists'] | |
leaf_tags = ['clip', 'lit', 'lit-tag', 'with-param', 'var', 'b', 'list', 'pattern-item'] | |
class ExpatParser(object): | |
def __init__(self, fileName, compiler): | |
self.fileName = fileName |
This file contains hidden or 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 xml.parsers.expat | |
import codecs | |
from pprint import pprint | |
import sys | |
DEBUG_MODE = False | |
# this stack holds information of the tree | |
stack = [] | |
# genereated codes are held in the this stack and merged when necessary |
This file contains hidden or 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
<choose> | |
<when> # label -> when1_start | |
<test> | |
<in caseless="yes"/> # caseless mode on | |
<clip pos="1" side="sl" part="lem"/> # push 1, and push regex, clipsl | |
<list n="verbos_est"/> | |
</in> | |
</test> # jnz when1_when1_end | |
<let> | |
<clip pos="2" side="tl" part="lem"/> # check parent if let and if clip is its first child |
This file contains hidden or 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 xml.parsers.expat | |
import codecs | |
from pprint import pprint | |
import sys | |
DEBUG_MODE = False | |
# this stack holds information of the tree | |
stack = [] | |
# genereated codes are held in the this stack and merged when necessary |
This file contains hidden or 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 xml.parsers.expat | |
import codecs | |
from pprint import pprint | |
stack = [] | |
codestack = [] | |
def_cats = {} | |
def_attrs = {} | |
def_attrs_regex = {} | |
def_lists = {} |
This file contains hidden or 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
<def-macro n="f_bcond" npar="2"><!--Per mirar si el blanc conté o no format --> | |
<choose> | |
<when> | |
<test> | |
<not> | |
<equal> | |
<b pos="1"/> | |
<lit v=" "/> | |
</equal> | |
</not> |
This file contains hidden or 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 <iostream> | |
#include <string> | |
#include <fstream> | |
typedef std::basic_filebuf<wchar_t, std::char_traits<wchar_t> > wfilebuf_t; | |
#define BUFFER_SIZE 512 | |
using namespace std; |
This file contains hidden or 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
#ifndef _Ltstr_ | |
#define _Ltstr_ | |
#include <string> | |
#include <cwchar> | |
#include <cstring> | |
using namespace std; | |
struct Ltstr |