Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

executable file 71 lines (56 sloc) 1.528 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
#!/usr/bin/env ruby

require 'rubygems'
require 'treetop'

Treetop.load "BibTex"

parser = BibTexParser.new


f = File.open('bibliographie.bib')
#tree = parser.parse(f.read)

=begin
=end
txt = <<x
% This file was created with JabRef 2.3.1.
% Encoding: UTF-8

@BOOK{Zienkiewicz2,
title = {The Finite Element Method},
publisher = {Butterworth-Heinemann},
year = {2000},
author = {O.C. Zienkiewicz and R.L. Taylor},
volume = {Solid Mechanics},
edition = {Fifth Edition},
file = {:home/lecarme/Documents/Biblio/Books and thesis/Finite Element Method
- Solid mechanics - Zienkiewicz and Taylor.pdf:PDF},
owner = {lecarme},
timestamp = {27.01.2009}
}

@BOOK{Anderson2005,
title = {Fracture mechanics, fundamentals and applications},
publisher = {CRC Press},
year = {2005},
editor = {Taylor and Francis group},
author = {Anderson, Ted L.},
edition = {3rd},
owner = {lecarme},
timestamp = {18.05.2009}
}
@BOOK{Abaqus,
title = {ABAQUS Theory Manual Version 6.3},
publisher = {Hibbitt, Karlsson and Sorenson Inc.},
year = {2002},
owner = {lecarme},
timestamp = {12.06.2009}
}

@comment{jabref-meta: selector_publisher:}

@comment{jabref-meta: selector_author:}

@comment{jabref-meta: selector_journal:}

@comment{jabref-meta: selector_keywords:}


x
#txt = " beuha= {aussi\n heing?}, machin = truc\n\n, pim = {pam\n}"
#txt = "Zienkiewicz2"
txt = f.read
tree = parser.parse(txt)
puts tree
tree.elements.each do |element|
puts element, element.text_value
#.inspect
#.label
end
Something went wrong with that request. Please try again.